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
711711 {
712712 return cpuid_edx(kvm_cpuid_base() | KVM_CPUID_FEATURES);
713713 }
714+EXPORT_SYMBOL_GPL(kvm_arch_para_hints);
714715
715716 static uint32_t __init kvm_detect(void)
716717 {
drivers/cpuidle/cpuidle-haltpoll.c+2−1
@@ -97,7 +97,8 @@ static int __init haltpoll_init(void) · 96 unmodified lines
9797
9898 cpuidle_poll_state_init(drv);
9999
100− if (!kvm_para_available())
100+ if (!kvm_para_available() ||
101+ !kvm_para_has_hint(KVM_HINTS_REALTIME))
101102 return -ENODEV;
102103
103104 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