Skip to contentSkip to conversation

KVM: MMU: drop zeroing on mmu_memory_cache_alloc

PATCH Applied Marcelo Tosatti 2 participants 2 messages Jan 8, 2009 – Jan 11, 2009

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

Zeroing on mmu_memory_cache_alloc is unnecessary since:

- Smaller areas are pre-allocated with kmem_cache_zalloc.
- Page pointed by ->spt is overwritten with prefetch_page and entries in page pointed by ->gfns are initialized before reading.

[avi: zeroing pages is unnecessary]

arch/x86/kvm/mmu.c +0 -1
index 10bdb2a..823d0cd 100644
@@ -352,7 +352,6 @@ static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc,
 
 	BUG_ON(!mc->nobjs);
 	p = mc->objects[--mc->nobjs];
-	memset(p, 0, size);
 	return p;
 }
 
Applied
#1 lore raw
Quoted 10 lines · Marcelo Tosatti

Zeroing on mmu_memory_cache_alloc is unnecessary since:

- Smaller areas are pre-allocated with kmem_cache_zalloc.
- Page pointed by ->spt is overwritten with prefetch_page and entries in page pointed by ->gfns are initialized before reading.

[avi: zeroing pages is unnecessary]

Applied, thanks.

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