Re: [PATCH v2] KVM: MMU: Fix mmu_shrink() so that it can free mmu pages as intended

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/20/2012 12:35 PM, Takuya Yoshikawa wrote:
> Although the possible race described in
> 
>   commit 85b7059169e128c57a3a8a3e588fb89cb2031da1
>   KVM: MMU: fix shrinking page from the empty mmu
> 
> was correct, the real cause of that issue was a more trivial bug of
> mmu_shrink() introduced by
> 
>   commit 1952639665e92481c34c34c3e2a71bf3e66ba362
>   KVM: MMU: do not iterate over all VMs in mmu_shrink()
> 
> Here is the bug:
> 
> 	if (kvm->arch.n_used_mmu_pages > 0) {
> 		if (!nr_to_scan--)
> 			break;
> 		continue;
> 	}
> 
> We skip VMs whose n_used_mmu_pages is not zero and try to shrink others:
> in other words we try to shrink empty ones by mistake.
> 
> This patch reverses the logic so that mmu_shrink() can free pages from
> the first VM whose n_used_mmu_pages is not zero.  Note that we also add
> comments explaining the role of nr_to_scan which is not practically
> important now, hoping this will be improved in the future.
> 
> Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@xxxxxxxxxxxxx>

Thanks, applied to master for 3.6.


-- 
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux