diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2019-03-05 05:30:01 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2019-04-26 09:08:17 +0200 |
commit | cdd6ad3ac63d2fa320baefcf92a02a918375c30f (patch) | |
tree | 0f4c98d67883cf3dfa08cd2731d3a9497ea4ccf7 /virt | |
parent | 8ec2fa52eac53bff7ef1cedbc4ad8af650ec937c (diff) | |
download | lwn-cdd6ad3ac63d2fa320baefcf92a02a918375c30f.tar.gz lwn-cdd6ad3ac63d2fa320baefcf92a02a918375c30f.zip |
KVM: polling: add architecture backend to disable polling
There are cases where halt polling is unwanted. For example when running
KVM on an over committed LPAR we rather want to give back the CPU to
neighbour LPARs instead of polling. Let us provide a callback that
allows architectures to disable polling.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/Kconfig | 3 | ||||
-rw-r--r-- | virt/kvm/kvm_main.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index ea434ddc8499..aad9284c043a 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -57,3 +57,6 @@ config HAVE_KVM_VCPU_ASYNC_IOCTL config HAVE_KVM_VCPU_RUN_PID_CHANGE bool + +config HAVE_KVM_NO_POLL + bool diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 55fe8e20d8fd..23aec2f4ba71 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2253,7 +2253,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) u64 block_ns; start = cur = ktime_get(); - if (vcpu->halt_poll_ns) { + if (vcpu->halt_poll_ns && !kvm_arch_no_poll(vcpu)) { ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns); ++vcpu->stat.halt_attempted_poll; |