Re: [PATCH] KVM: MMU: Fix free memory accounting race in mmu_alloc_roots()

2010-05-11 Thread Marcelo Tosatti
On Mon, May 10, 2010 at 12:09:56PM +0300, Avi Kivity wrote: We drop the mmu lock between freeing memory and allocating the roots; this allows some other vcpu to sneak in and allocate memory. While the race is benign (resulting only in temporary overallocation, not oom) it is simple and easy

[PATCH] KVM: MMU: Fix free memory accounting race in mmu_alloc_roots()

2010-05-10 Thread Avi Kivity
We drop the mmu lock between freeing memory and allocating the roots; this allows some other vcpu to sneak in and allocate memory. While the race is benign (resulting only in temporary overallocation, not oom) it is simple and easy to fix by moving the freeing close to the allocation.