kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] KVM: PPC: Book3S HV: exit halt polling on need_resched() as well
@ 2021-05-08  9:31 Wanpeng Li
  2021-05-08  9:31 ` [PATCH 2/3] KVM: X86: Bail out of direct yield in case of undercomitted scenarios Wanpeng Li
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Wanpeng Li @ 2021-05-08  9:31 UTC (permalink / raw)
  To: linux-kernel, kvm
  Cc: Paolo Bonzini, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
	Jim Mattson, Joerg Roedel, Paul Mackerras

From: Wanpeng Li <wanpengli@tencent.com>

Inspired by commit 262de4102c7bb8 (kvm: exit halt polling on need_resched() 
as well), due to PPC implements an arch specific halt polling logic, we should 
add the need_resched() checking there as well.

Cc: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
---
 arch/powerpc/kvm/book3s_hv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 28a80d2..6199397 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -3936,7 +3936,8 @@ static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc)
 				break;
 			}
 			cur = ktime_get();
-		} while (single_task_running() && ktime_before(cur, stop));
+		} while (single_task_running() && !need_resched() &&
+			 ktime_before(cur, stop));
 
 		spin_lock(&vc->lock);
 		vc->vcore_state = VCORE_INACTIVE;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-12 17:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  9:31 [PATCH 1/3] KVM: PPC: Book3S HV: exit halt polling on need_resched() as well Wanpeng Li
2021-05-08  9:31 ` [PATCH 2/3] KVM: X86: Bail out of direct yield in case of undercomitted scenarios Wanpeng Li
2021-05-11 21:44   ` Sean Christopherson
2021-05-12  2:43     ` Wanpeng Li
2021-05-12 16:59       ` Sean Christopherson
2021-05-08  9:31 ` [PATCH 3/3] KVM: X86: Fix vCPU preempted state from guest point of view Wanpeng Li
2021-05-11  0:18   ` Sean Christopherson
2021-05-11 10:28     ` Wanpeng Li
2021-05-12  0:02 ` [PATCH 1/3] KVM: PPC: Book3S HV: exit halt polling on need_resched() as well Wanpeng Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).