KVM: MMU: Add cache miss statistic
authorAvi Kivity <avi@qumranet.com>
Tue, 18 Dec 2007 17:47:18 +0000 (19:47 +0200)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 16:01:19 +0000 (18:01 +0200)
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/mmu.c
arch/x86/kvm/x86.c
include/asm-x86/kvm_host.h

index 9a57e1a0144931010f3bd85e984209e010852552..8f12ec52ad8601ed4b657f5f6858e27f2f40fc09 100644 (file)
@@ -715,6 +715,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
                        pgprintk("%s: found\n", __FUNCTION__);
                        return sp;
                }
+       ++vcpu->kvm->stat.mmu_cache_miss;
        sp = kvm_mmu_alloc_page(vcpu, parent_pte);
        if (!sp)
                return sp;
index 733bff65d9a9b54c5280d7e901229b49140491ab..fa9e42c037419e51c1831ea62ec53d73349dbc20 100644 (file)
@@ -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) },
+       { "mmu_cache_miss", VM_STAT(mmu_cache_miss) },
        { "remote_tlb_flush", VM_STAT(remote_tlb_flush) },
        { NULL }
 };
index 28940e1a97138df7cfa9939488125cd576c7fb77..ced1bebabbc84d46f78886fba197d6d7a096b026 100644 (file)
@@ -289,6 +289,7 @@ struct kvm_vm_stat {
        u32 mmu_pde_zapped;
        u32 mmu_flooded;
        u32 mmu_recycled;
+       u32 mmu_cache_miss;
        u32 remote_tlb_flush;
 };