Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpuidle-haltpoll: Enable kvm guest polling when dedicated physical CPUs are available

The downside of guest side polling is that polling is performed even
with other runnable tasks in the host. However, even if poll in kvm
can aware whether or not other runnable tasks in the same pCPU, it
can still incur extra overhead in over-subscribe scenario. Now we can
just enable guest polling when dedicated pCPUs are available.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Wanpeng Li and committed by
Rafael J. Wysocki
1328edca 472f2636

+3 -1
+1
arch/x86/kernel/kvm.c
··· 711 711 { 712 712 return cpuid_edx(kvm_cpuid_base() | KVM_CPUID_FEATURES); 713 713 } 714 + EXPORT_SYMBOL_GPL(kvm_arch_para_hints); 714 715 715 716 static uint32_t __init kvm_detect(void) 716 717 {
+2 -1
drivers/cpuidle/cpuidle-haltpoll.c
··· 97 97 98 98 cpuidle_poll_state_init(drv); 99 99 100 - if (!kvm_para_available()) 100 + if (!kvm_para_available() || 101 + !kvm_para_has_hint(KVM_HINTS_REALTIME)) 101 102 return -ENODEV; 102 103 103 104 ret = cpuidle_register_driver(drv);