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.
Unified · Split
| @@ -711,6 +711,7 @@ unsigned int kvm_arch_para_hints(void) · 710 unmodified lines | ||
| 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 | { |
| @@ -97,7 +97,8 @@ static int __init haltpoll_init(void) · 96 unmodified lines | ||
| 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); |