KVM: MMU: increase per-vcpu rmap cache alloc size
authorMarcelo Tosatti <mtosatti@redhat.com>
Tue, 28 Oct 2008 20:16:58 +0000 (18:16 -0200)
committerAvi Kivity <avi@redhat.com>
Tue, 11 Nov 2008 18:53:34 +0000 (20:53 +0200)
The page fault path can use two rmap_desc structures, if:

- walk_addr's dirty pte update allocates one rmap_desc.
- mmu_lock is dropped, sptes are zapped resulting in rmap_desc being
freed.
- fetch->mmu_set_spte allocates another rmap_desc.

Increase to 4 for safety.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c

index 2a5e64881d9bf2476bfef280ca309ffe086e52e1..f1983d9477cd163bc13de766f1edd8ffee4c720b 100644 (file)
@@ -314,7 +314,7 @@ static int mmu_topup_memory_caches(struct kvm_vcpu *vcpu)
        if (r)
                goto out;
        r = mmu_topup_memory_cache(&vcpu->arch.mmu_rmap_desc_cache,
-                                  rmap_desc_cache, 1);
+                                  rmap_desc_cache, 4);
        if (r)
                goto out;
        r = mmu_topup_memory_cache_page(&vcpu->arch.mmu_page_cache, 8);