Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bc7ae25 authored by Raghavendra K T's avatar Raghavendra K T Committed by Gleb Natapov
Browse files

kvm: Iterate over only vcpus that are preempted



This helps in filtering out the eligible candidates further and
thus potentially helps in quickly allowing preempted lockholders to run.
Note that if a vcpu was spinning during preemption we filter them
by checking whether they are preempted due to pause loop exit.

Reviewed-by: default avatarChegu Vinod <chegu_vinod@hp.com>
Reviewed-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: default avatarRaghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
parent 3a08a8f9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1768,6 +1768,8 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
				continue;
			} else if (pass && i > last_boosted_vcpu)
				break;
			if (!ACCESS_ONCE(vcpu->preempted))
				continue;
			if (vcpu == me)
				continue;
			if (waitqueue_active(&vcpu->wq))