aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorRaghavendra K T <raghavendra.kt@linux.vnet.ibm.com>2012-07-18 09:37:46 -0400
committerAvi Kivity <avi@redhat.com>2012-07-23 06:01:52 -0400
commit4c088493c8d07e4e27bad53a99dcfdc14cdf45f8 (patch)
treeb90cfa07e207bb938b6997ae62c774c0624b0dd6 /virt/kvm/kvm_main.c
parentf2a743473194a1ad44a85f8b63aeef9d63e5bf47 (diff)
KVM: Note down when cpu relax intercepted or pause loop exited
Noting pause loop exited vcpu or cpu relax intercepted helps in filtering right candidate to yield. Wrong selection of vcpu; i.e., a vcpu that just did a pl-exit or cpu relax intercepted may contribute to performance degradation. Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Reviewed-by: Rik van Riel <riel@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> # on s390x Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 68dda513cd7..0892b75eeed 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -239,6 +239,9 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
239 } 239 }
240 vcpu->run = page_address(page); 240 vcpu->run = page_address(page);
241 241
242 kvm_vcpu_set_in_spin_loop(vcpu, false);
243 kvm_vcpu_set_dy_eligible(vcpu, false);
244
242 r = kvm_arch_vcpu_init(vcpu); 245 r = kvm_arch_vcpu_init(vcpu);
243 if (r < 0) 246 if (r < 0)
244 goto fail_free_run; 247 goto fail_free_run;
@@ -1585,6 +1588,7 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
1585 int pass; 1588 int pass;
1586 int i; 1589 int i;
1587 1590
1591 kvm_vcpu_set_in_spin_loop(me, true);
1588 /* 1592 /*
1589 * We boost the priority of a VCPU that is runnable but not 1593 * We boost the priority of a VCPU that is runnable but not
1590 * currently running, because it got preempted by something 1594 * currently running, because it got preempted by something
@@ -1610,6 +1614,7 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
1610 } 1614 }
1611 } 1615 }
1612 } 1616 }
1617 kvm_vcpu_set_in_spin_loop(me, false);
1613} 1618}
1614EXPORT_SYMBOL_GPL(kvm_vcpu_on_spin); 1619EXPORT_SYMBOL_GPL(kvm_vcpu_on_spin);
1615 1620