aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorRaghavendra K T <raghavendra.kt@linux.vnet.ibm.com>2013-03-04 13:02:27 -0500
committerGleb Natapov <gleb@redhat.com>2013-03-11 05:37:22 -0400
commit7bc7ae25b1438bb9fe1f176b951d758789847640 (patch)
tree47d7e933d79152b9272b101e68bd0ad43c4ec918 /virt/kvm/kvm_main.c
parent3a08a8f9f0936e182d387afd85fdc5d303381521 (diff)
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: Chegu Vinod <chegu_vinod@hp.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 470f2bc8205a..ff7154188b5f 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1768,6 +1768,8 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
1768 continue; 1768 continue;
1769 } else if (pass && i > last_boosted_vcpu) 1769 } else if (pass && i > last_boosted_vcpu)
1770 break; 1770 break;
1771 if (!ACCESS_ONCE(vcpu->preempted))
1772 continue;
1771 if (vcpu == me) 1773 if (vcpu == me)
1772 continue; 1774 continue;
1773 if (waitqueue_active(&vcpu->wq)) 1775 if (waitqueue_active(&vcpu->wq))