From: Avi Kivity Date: Tue, 20 Nov 2007 21:01:14 +0000 (+0200) Subject: KVM: Add statistic for remote tlb flushes X-Git-Tag: v2.6.25-rc1~1138^2~104 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=0f74a24c59b814c1c8085251cbea48d339f0c7c6;p=linux-2.6-omap-h63xx.git KVM: Add statistic for remote tlb flushes Signed-off-by: Avi Kivity --- diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index b65f5dee4b1..048849d97b3 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -300,6 +300,7 @@ struct kvm_vm_stat { u32 mmu_pde_zapped; u32 mmu_flooded; u32 mmu_recycled; + u32 remote_tlb_flush; }; struct kvm { diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 7939b5c9a4b..aec6b67cfeb 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) if (cpu != -1 && cpu != raw_smp_processor_id()) cpu_set(cpu, cpus); } + if (cpus_empty(cpus)) + return; + ++kvm->stat.remote_tlb_flush; smp_call_function_mask(cpus, ack_flush, NULL, 1); } diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c index b482b6a8a82..ac09f381f47 100644 --- a/drivers/kvm/x86.c +++ b/drivers/kvm/x86.c @@ -73,6 +73,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { { "mmu_pde_zapped", VM_STAT(mmu_pde_zapped) }, { "mmu_flooded", VM_STAT(mmu_flooded) }, { "mmu_recycled", VM_STAT(mmu_recycled) }, + { "remote_tlb_flush", VM_STAT(remote_tlb_flush) }, { NULL } };