KVM: make halt_poll_ns per-vCPU
Change halt_poll_ns into per-VCPU variable, seeded from module parameter, to allow greater flexibility. Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e8dd2d2d64
commit
19020f8ab8
@ -242,6 +242,7 @@ struct kvm_vcpu {
|
||||
int sigset_active;
|
||||
sigset_t sigset;
|
||||
struct kvm_vcpu_stat stat;
|
||||
unsigned int halt_poll_ns;
|
||||
|
||||
#ifdef CONFIG_HAS_IOMEM
|
||||
int mmio_needed;
|
||||
|
@ -217,6 +217,7 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
|
||||
vcpu->kvm = kvm;
|
||||
vcpu->vcpu_id = id;
|
||||
vcpu->pid = NULL;
|
||||
vcpu->halt_poll_ns = 0;
|
||||
init_waitqueue_head(&vcpu->wq);
|
||||
kvm_async_pf_vcpu_init(vcpu);
|
||||
|
||||
@ -1930,8 +1931,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
|
||||
bool waited = false;
|
||||
|
||||
start = cur = ktime_get();
|
||||
if (halt_poll_ns) {
|
||||
ktime_t stop = ktime_add_ns(ktime_get(), halt_poll_ns);
|
||||
if (vcpu->halt_poll_ns) {
|
||||
ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns);
|
||||
|
||||
do {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user