From: Avi Kivity <avi@redhat.com>
To: Takuya Yoshikawa <takuya.yoshikawa@gmail.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp
Subject: Re: [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages
Date: Mon, 19 Dec 2011 10:43:27 +0200 [thread overview]
Message-ID: <4EEEF92F.9020807@redhat.com> (raw)
In-Reply-To: <20111216235824.a8016959785b2bd869b84a0a@gmail.com>
On 12/16/2011 04:58 PM, Takuya Yoshikawa wrote:
> >
> > I'm not sure this is a meaningful test to verify this change is
> > worthwhile, because while the shrinker tries to free a shadow page from
> > one vm, the vm's position in the kvm list is changed, so the over time
> > the shrinker will cycle over all VMs.
>
> The test was for checking if mmu_shrink() would work as intended. Maybe
> not good as a changelog, sorry.
>
>
> I admit that I could not find any strong reason except for protecting the
> host from intentionally induced shadowing.
>
> But for that, don't you think that freeing the same amount of shadow pages
> from good and bad VMs eaqually is bad thing?
>
> My method will try to free many shadow pages from VMs with many shadow
> pages; e.g. if there is a pathological increase in shadow pages for one
> VM, that one will be intensively treated.
>
> If you can agree on this reasoning, I will update the description and resend.
Well, if one guest is twice as large as other guests, then it will want
twice as many shadow pages. So our goal should be to zap pages from the
guest with the highest (shadow pages / memory) ratio.
> >
> > Can you measure whether there is a significant difference in a synthetic
> > workload, and what that change is? Perhaps apply {moderate, high} memory
> > pressure load with {2, 4, 8, 16} VMs or something like that.
> >
>
> I was running 4 VMs on my machine with enough high memory pressure. The problem
> was that mmu_shrink() was not tuned to be called in usual memory pressures: what
> I did was changing the seeks and batch parameters and making ept=0.
>
> At least, I have checked that if I make one VM do meaningless many copies, letting
> others keep silent, the shrinker frees shadow pages intensively from that one.
>
>
> Anyway, I don't think making the shrinker call mmu_shrink() with the default batch
> size, nr_to_scan=128, and just trying to free one shadow page is a good behaviour.
Yes, it's very conservative. But on the other hand the shrinker is
tuned for dcache and icache, where there are usually tons of useless
objects. If we have to free something, I'd rather free them instead of
mmu pages which tend to get recreated soon.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2011-12-19 8:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-11 22:22 [PATCH 0/4] KVM: Make mmu_shrink() scan nr_to_scan shadow pages Takuya Yoshikawa
2011-12-11 22:24 ` [PATCH 1/4] KVM: Rename vm_list to kvm_list to avoid confusion Takuya Yoshikawa
2011-12-12 3:16 ` Xiao Guangrong
2011-12-12 4:04 ` Takuya Yoshikawa
2011-12-12 4:51 ` Xiao Guangrong
2011-12-12 7:10 ` Takuya Yoshikawa
2011-12-11 22:24 ` [PATCH 2/4] KVM: MMU: Make common preparation code for zapping sp into a function Takuya Yoshikawa
2011-12-11 22:25 ` [PATCH 3/4] KVM: MMU: Make preparation for zapping some sp into a separate function Takuya Yoshikawa
2011-12-12 1:19 ` Takuya Yoshikawa
2011-12-11 22:26 ` [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages Takuya Yoshikawa
2011-12-16 11:06 ` Marcelo Tosatti
2011-12-16 14:58 ` Takuya Yoshikawa
2011-12-19 8:43 ` Avi Kivity [this message]
2011-12-19 9:22 ` Takuya Yoshikawa
2011-12-19 9:26 ` Avi Kivity
2011-12-19 9:56 ` Takuya Yoshikawa
2011-12-19 10:03 ` Avi Kivity
2011-12-19 10:21 ` Takuya Yoshikawa
2011-12-19 10:24 ` Avi Kivity
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=4EEEF92F.9020807@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).