From 1328edca4a142ee3c7442d1eece2c3ca383eff35 Mon Sep 17 00:00:00 2001 From: Wanpeng Li Date: Thu, 29 Aug 2019 16:49:57 +0800 Subject: 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 Signed-off-by: Wanpeng Li Signed-off-by: Rafael J. Wysocki --- drivers/cpuidle/cpuidle-haltpoll.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/cpuidle') diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index 49a65c6fe91e..932390b028f1 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -97,7 +97,8 @@ static int __init haltpoll_init(void) cpuidle_poll_state_init(drv); - if (!kvm_para_available()) + if (!kvm_para_available() || + !kvm_para_has_hint(KVM_HINTS_REALTIME)) return -ENODEV; ret = cpuidle_register_driver(drv); -- cgit v1.2.3