From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [PATCH RESEND] KVM: MMU: Fix mmu_shrink() so that it can free mmu pages as intended Date: Tue, 14 Aug 2012 09:06:51 +0900 Message-ID: <20120814090651.d7aa468cbdafe6a18ce5c269@gmail.com> References: <20120810171612.f1e48237.yoshikawa.takuya@oss.ntt.co.jp> <20120813221523.GA21083@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , avi@redhat.com, kvm@vger.kernel.org, gleb@redhat.com To: Marcelo Tosatti Return-path: Received: from mail-yw0-f46.google.com ([209.85.213.46]:52314 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755223Ab2HNAG5 (ORCPT ); Mon, 13 Aug 2012 20:06:57 -0400 Received: by yhmm54 with SMTP id m54so3911860yhm.19 for ; Mon, 13 Aug 2012 17:06:56 -0700 (PDT) In-Reply-To: <20120813221523.GA21083@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 13 Aug 2012 19:15:23 -0300 Marcelo Tosatti wrote: > On Fri, Aug 10, 2012 at 05:16:12PM +0900, Takuya Yoshikawa wrote: > > The following commit changed mmu_shrink() so that it would skip VMs > > whose n_used_mmu_pages was not zero and try to free pages from others: > > > > commit 1952639665e92481c34c34c3e2a71bf3e66ba362 > > KVM: MMU: do not iterate over all VMs in mmu_shrink() > > > > This patch fixes the function so that it can free mmu pages as before. > > Note that "if (!nr_to_scan--)" check is removed since we do not try to > > free mmu pages from more than one VM. > > > > Signed-off-by: Takuya Yoshikawa > > Cc: Gleb Natapov > > --- > > This patch just recovers the original behaviour and is not related > > to how to improve mmu_shrink() further; so please apply. > > Before 1952639665e92481c34 the code was maxed at nr_to_scan loops. So > removing if (!nr_to_scan--) patch does change behaviour. > > Am i missing something here? No. You are right about that. But as Gleb and I confirmed when I first sent this patch, the possiblity that we see "n_used_mmu_pages == 0" 128 times is quite low that it is almost impossible to see the effect. If you prefer to have the check, I will do so. Thanks, Takuya