public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Cc: Takuya Yoshikawa <takuya.yoshikawa@gmail.com>,
	Gleb Natapov <gleb@redhat.com>,
	avi@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: MMU: Fix mmu_shrink() so that it can free mmu pages as intended
Date: Wed, 18 Jul 2012 17:52:46 -0300	[thread overview]
Message-ID: <20120718205246.GB18886@amt.cnet> (raw)
In-Reply-To: <20120712183509.8e04491c.yoshikawa.takuya@oss.ntt.co.jp>

On Thu, Jul 12, 2012 at 06:35:09PM +0900, Takuya Yoshikawa wrote:
> On Thu, 5 Jul 2012 23:05:46 +0900
> Takuya Yoshikawa <takuya.yoshikawa@gmail.com> wrote:
> 
> > On Thu, 5 Jul 2012 14:50:00 +0300
> > Gleb Natapov <gleb@redhat.com> wrote:
> > 
> > > > Note that "if (!nr_to_scan--)" check is removed since we do not try to
> > > > free mmu pages from more than one VM.
> > > > 
> > > IIRC this was proposed in the past that we should iterate over vm list
> > > until freeing something eventually, but Avi was against it. I think the
> > > probability of a VM with kvm->arch.n_used_mmu_pages == 0 is low, so
> > > it looks OK to drop nr_to_scan to me.
> > 
> > Since our batch size is 128, the minimum positive @nr_to_scan, it's almost
> > impossible to see the effect of the check.
> 
> Thinking more about this:
> 
> I think freeing mmu pages by shrink_slab() is problematic.
> 
> For example, if we do
>  # echo 2 /proc/sys/vm/drop_caches
> on the host, some mmu pages will be freed.
> 
> This is not what most people expect, probably.
> 
> 
> Although this patch is needed to care about shadow paging's extreme
> mmu page usage, we should do somthing better in the future.
> 
> What I think reasonable is not treating all mmu pages as freeable:
>  - determine some base number of mmu pages: base_mmu_pages
>  - return (total_mmu_pages - base_mmu_pages) to the caller
> 
>  * We may use n_max_mmu_pages for calculating this base number.
> 
> By doing so, we can avoid freeing mmu pages especially when EPT/NPT ON.

Takuya,

Can't understand, can you please expand more clearly? 

TIA


  reply	other threads:[~2012-07-18 20:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-05 10:56 [PATCH] KVM: MMU: Fix mmu_shrink() so that it can free mmu pages as intended Takuya Yoshikawa
2012-07-05 11:50 ` Gleb Natapov
2012-07-05 14:05   ` Takuya Yoshikawa
2012-07-12  9:35     ` Takuya Yoshikawa
2012-07-18 20:52       ` Marcelo Tosatti [this message]
2012-07-20  1:04         ` Takuya Yoshikawa
2012-07-20 14:42           ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120718205246.GB18886@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=takuya.yoshikawa@gmail.com \
    --cc=yoshikawa.takuya@oss.ntt.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox