Skip to contentSkip to conversation

KVM: MMU: increase per-vcpu rmap cache alloc size

PATCH Marcelo Tosatti 2 participants 2 messages Oct 28, 2008 – Oct 29, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

arch/x86/kvm/mmu.c +1 -1
index 79cb4a9..2477a24 100644
@@ -316,7 +316,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);
#1 lore raw
Quoted 9 lines · Marcelo Tosatti

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.

Applied and queued for 2.6.28, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function