aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-11-20 16:01:14 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:53:10 -0500
commit0f74a24c59b814c1c8085251cbea48d339f0c7c6 (patch)
tree1102e9835f247b7c9d05887f36e2f8fa3b20681a /drivers
parente5a4c8cad952d6e060991841f3632578ab3ae133 (diff)
KVM: Add statistic for remote tlb flushes
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/kvm/kvm.h1
-rw-r--r--drivers/kvm/kvm_main.c3
-rw-r--r--drivers/kvm/x86.c1
3 files changed, 5 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index b65f5dee4b1b..048849d97b35 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -300,6 +300,7 @@ struct kvm_vm_stat {
300 u32 mmu_pde_zapped; 300 u32 mmu_pde_zapped;
301 u32 mmu_flooded; 301 u32 mmu_flooded;
302 u32 mmu_recycled; 302 u32 mmu_recycled;
303 u32 remote_tlb_flush;
303}; 304};
304 305
305struct kvm { 306struct kvm {
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 7939b5c9a4b4..aec6b67cfebb 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -115,6 +115,9 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
115 if (cpu != -1 && cpu != raw_smp_processor_id()) 115 if (cpu != -1 && cpu != raw_smp_processor_id())
116 cpu_set(cpu, cpus); 116 cpu_set(cpu, cpus);
117 } 117 }
118 if (cpus_empty(cpus))
119 return;
120 ++kvm->stat.remote_tlb_flush;
118 smp_call_function_mask(cpus, ack_flush, NULL, 1); 121 smp_call_function_mask(cpus, ack_flush, NULL, 1);
119} 122}
120 123
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index b482b6a8a828..ac09f381f47f 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -73,6 +73,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
73 { "mmu_pde_zapped", VM_STAT(mmu_pde_zapped) }, 73 { "mmu_pde_zapped", VM_STAT(mmu_pde_zapped) },
74 { "mmu_flooded", VM_STAT(mmu_flooded) }, 74 { "mmu_flooded", VM_STAT(mmu_flooded) },
75 { "mmu_recycled", VM_STAT(mmu_recycled) }, 75 { "mmu_recycled", VM_STAT(mmu_recycled) },
76 { "remote_tlb_flush", VM_STAT(remote_tlb_flush) },
76 { NULL } 77 { NULL }
77}; 78};
78 79