From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
To: Avi Kivity <avi@redhat.com>
Cc: Takuya Yoshikawa <takuya.yoshikawa@gmail.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH 4/4] KVM: MMU: Make mmu_shrink() scan nr_to_scan shadow pages
Date: Mon, 19 Dec 2011 19:21:37 +0900 [thread overview]
Message-ID: <4EEF1031.8090801@oss.ntt.co.jp> (raw)
In-Reply-To: <4EEF0C02.5000906@redhat.com>
(2011/12/19 19:03), Avi Kivity wrote:
>> IMO, The goal should be restricted to emergencies.
>>
>> So possible solution may be:
>> - we set the tuning parameters as conservative as possible
>> - pick up a guest with relatively high ratio
>> (I have to think more how to achieve this)
>> - move the vm_list head for fairness
>>
>> In an emergency, we should not mind performance penalty so much.
>
> But is the shrinker really only called in emergencies?
No, sadly.
That is the problem.
>
> Also, with things like cgroups, we may have an emergency in one
> container, but not in others - if the shrinker is not cgroup aware, it
> soon will be.
That seems to be a common problem for everyone, not KVM only.
>> But there is not a perfect value because how often mmu_shrink() can be
>> called
>> will change if the admin change the sysctl_vfs_cache_pressure tuning
>> parameter
>> for dcache and icache, IIUC.
>>
>> And tdp and shadow paging differ much.
>
> We should aim for the following:
> - normal operation causes very little shrinks (some are okay)
> - high pressure mostly due to kvm results in kvm being shrunk (this is a
> pathological case caused by a starting a guest with a huge amount of
> memory, and mapping it all to /dev/zero (or ksm), and getting the guest
> the create shadow mappings for all of it)
> - general high pressure is shared among other caches like dcache and icache
>
> The cost of reestablishing an mmu page can be as high as half a
> millisecond of cpu time, which is the reason I want to be conservative.
>
I agree with you.
I feel that I should add lkml in CC next time to hear from mm specialist.
Shrinker has many heuristics added from a lot of experience; my lack of
such experience means I need help.
Takuya
next prev parent reply other threads:[~2011-12-19 10:20 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
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 [this message]
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=4EEF1031.8090801@oss.ntt.co.jp \
--to=yoshikawa.takuya@oss.ntt.co.jp \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=takuya.yoshikawa@gmail.com \
/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).