diff options
author | Avi Kivity <avi@qumranet.com> | 2007-04-19 10:27:43 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-05-03 03:52:30 -0400 |
commit | 1165f5fec18c077bdba88e7125fd41f8e3617cb4 (patch) | |
tree | a1931bfddfabaa909f4ebd14a5c00a549d1e37ec /drivers/kvm/svm.c | |
parent | 3fca03653010b8c5fa63b99fc94c78cbfb433d00 (diff) |
KVM: Per-vcpu statistics
Make the exit statistics per-vcpu instead of global. This gives a 3.5%
boost when running one virtual machine per core on my two socket dual core
(4 cores total) machine.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 61ed7352e506..644efc5381ad 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -914,7 +914,7 @@ static int pf_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
914 | case EMULATE_DONE: | 914 | case EMULATE_DONE: |
915 | return 1; | 915 | return 1; |
916 | case EMULATE_DO_MMIO: | 916 | case EMULATE_DO_MMIO: |
917 | ++kvm_stat.mmio_exits; | 917 | ++vcpu->stat.mmio_exits; |
918 | kvm_run->exit_reason = KVM_EXIT_MMIO; | 918 | kvm_run->exit_reason = KVM_EXIT_MMIO; |
919 | return 0; | 919 | return 0; |
920 | case EMULATE_FAIL: | 920 | case EMULATE_FAIL: |
@@ -1054,7 +1054,7 @@ static int io_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
1054 | unsigned long count; | 1054 | unsigned long count; |
1055 | gva_t address = 0; | 1055 | gva_t address = 0; |
1056 | 1056 | ||
1057 | ++kvm_stat.io_exits; | 1057 | ++vcpu->stat.io_exits; |
1058 | 1058 | ||
1059 | vcpu->svm->next_rip = vcpu->svm->vmcb->control.exit_info_2; | 1059 | vcpu->svm->next_rip = vcpu->svm->vmcb->control.exit_info_2; |
1060 | 1060 | ||
@@ -1096,7 +1096,7 @@ static int halt_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
1096 | return 1; | 1096 | return 1; |
1097 | 1097 | ||
1098 | kvm_run->exit_reason = KVM_EXIT_HLT; | 1098 | kvm_run->exit_reason = KVM_EXIT_HLT; |
1099 | ++kvm_stat.halt_exits; | 1099 | ++vcpu->stat.halt_exits; |
1100 | return 0; | 1100 | return 0; |
1101 | } | 1101 | } |
1102 | 1102 | ||
@@ -1264,7 +1264,7 @@ static int interrupt_window_interception(struct kvm_vcpu *vcpu, | |||
1264 | */ | 1264 | */ |
1265 | if (kvm_run->request_interrupt_window && | 1265 | if (kvm_run->request_interrupt_window && |
1266 | !vcpu->irq_summary) { | 1266 | !vcpu->irq_summary) { |
1267 | ++kvm_stat.irq_window_exits; | 1267 | ++vcpu->stat.irq_window_exits; |
1268 | kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; | 1268 | kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; |
1269 | return 0; | 1269 | return 0; |
1270 | } | 1270 | } |
@@ -1636,14 +1636,14 @@ again: | |||
1636 | r = handle_exit(vcpu, kvm_run); | 1636 | r = handle_exit(vcpu, kvm_run); |
1637 | if (r > 0) { | 1637 | if (r > 0) { |
1638 | if (signal_pending(current)) { | 1638 | if (signal_pending(current)) { |
1639 | ++kvm_stat.signal_exits; | 1639 | ++vcpu->stat.signal_exits; |
1640 | post_kvm_run_save(vcpu, kvm_run); | 1640 | post_kvm_run_save(vcpu, kvm_run); |
1641 | kvm_run->exit_reason = KVM_EXIT_INTR; | 1641 | kvm_run->exit_reason = KVM_EXIT_INTR; |
1642 | return -EINTR; | 1642 | return -EINTR; |
1643 | } | 1643 | } |
1644 | 1644 | ||
1645 | if (dm_request_for_irq_injection(vcpu, kvm_run)) { | 1645 | if (dm_request_for_irq_injection(vcpu, kvm_run)) { |
1646 | ++kvm_stat.request_irq_exits; | 1646 | ++vcpu->stat.request_irq_exits; |
1647 | post_kvm_run_save(vcpu, kvm_run); | 1647 | post_kvm_run_save(vcpu, kvm_run); |
1648 | kvm_run->exit_reason = KVM_EXIT_INTR; | 1648 | kvm_run->exit_reason = KVM_EXIT_INTR; |
1649 | return -EINTR; | 1649 | return -EINTR; |
@@ -1672,7 +1672,7 @@ static void svm_inject_page_fault(struct kvm_vcpu *vcpu, | |||
1672 | { | 1672 | { |
1673 | uint32_t exit_int_info = vcpu->svm->vmcb->control.exit_int_info; | 1673 | uint32_t exit_int_info = vcpu->svm->vmcb->control.exit_int_info; |
1674 | 1674 | ||
1675 | ++kvm_stat.pf_guest; | 1675 | ++vcpu->stat.pf_guest; |
1676 | 1676 | ||
1677 | if (is_page_fault(exit_int_info)) { | 1677 | if (is_page_fault(exit_int_info)) { |
1678 | 1678 | ||