History

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.

Wanpeng Li committed 7 years ago

Commit 1328edc1 parent 472f2632 files · +3 −1Browse files

Unified · Split

2 files
  1. arch/x86/kernel/kvm.c +1 −0
  2. drivers/cpuidle/cpuidle-haltpoll.c +2 −1
arch/x86/kernel/kvm.c+1−0
@@ -711,6 +711,7 @@ unsigned int kvm_arch_para_hints(void) · 710 unmodified lines
711{711{
712 return cpuid_edx(kvm_cpuid_base() | KVM_CPUID_FEATURES);712 return cpuid_edx(kvm_cpuid_base() | KVM_CPUID_FEATURES);
713}713}
714EXPORT_SYMBOL_GPL(kvm_arch_para_hints);
714 715
715static uint32_t __init kvm_detect(void)716static uint32_t __init kvm_detect(void)
716{717{
drivers/cpuidle/cpuidle-haltpoll.c+2−1
@@ -97,7 +97,8 @@ static int __init haltpoll_init(void) · 96 unmodified lines
97 97
98 cpuidle_poll_state_init(drv);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 return -ENODEV;102 return -ENODEV;
102 103
103 ret = cpuidle_register_driver(drv);104 ret = cpuidle_register_driver(drv);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t