* KVM: MMU: drop zeroing on mmu_memory_cache_alloc
@ 2009-01-08 19:44 Marcelo Tosatti
2009-01-11 7:14 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Tosatti @ 2009-01-08 19:44 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel
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]
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 10bdb2a..823d0cd 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: KVM: MMU: drop zeroing on mmu_memory_cache_alloc
2009-01-08 19:44 KVM: MMU: drop zeroing on mmu_memory_cache_alloc Marcelo Tosatti
@ 2009-01-11 7:14 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2009-01-11 7:14 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm-devel
Marcelo Tosatti wrote:
> 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.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-11 7:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-08 19:44 KVM: MMU: drop zeroing on mmu_memory_cache_alloc Marcelo Tosatti
2009-01-11 7:14 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).