KVM: add kvm_arch_vcpu_runnable() test to kvm_vcpu_on_spin() loop
authorMichael Mueller <mimu@linux.vnet.ibm.com>
Wed, 26 Feb 2014 15:14:18 +0000 (16:14 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Feb 2014 16:32:05 +0000 (17:32 +0100)
Use the arch specific function kvm_arch_vcpu_runnable() to add a further
criterium to identify a suitable vcpu to yield to during undirected yield
processing.

Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c

index f5668a431d54c14a91019d232995e1beaeef5d4e..5fd4cf8e8888585033d44cf113d2931b4de08572 100644 (file)
@@ -1801,7 +1801,7 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
                                continue;
                        if (vcpu == me)
                                continue;
-                       if (waitqueue_active(&vcpu->wq))
+                       if (waitqueue_active(&vcpu->wq) && !kvm_arch_vcpu_runnable(vcpu))
                                continue;
                        if (!kvm_vcpu_eligible_for_directed_yield(vcpu))
                                continue;