From: Paolo Bonzini <pbonzini@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>,
kvm@vger.kernel.org, xiaoguangrong@linux.vnet.ibm.com
Subject: Re: [PATCH] KVM: MMU: Inform users of mmio generation wraparound
Date: Thu, 20 Jun 2013 14:35:36 +0200 [thread overview]
Message-ID: <51C2F718.1010500@redhat.com> (raw)
In-Reply-To: <20130620114504.GG5832@redhat.com>
Il 20/06/2013 13:45, Gleb Natapov ha scritto:
> On Thu, Jun 20, 2013 at 12:59:54PM +0200, Paolo Bonzini wrote:
>> Il 20/06/2013 10:59, Takuya Yoshikawa ha scritto:
>>> Without this information, users will just see unexpected performance
>>> problems and there is little chance we will get good reports from them:
>>> note that mmio generation is increased even when we just start, or stop,
>>> dirty logging for some memory slot, in which case users should never
>>> expect all shadow pages to be zapped.
>>>
>>> Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
>>> ---
>>> arch/x86/kvm/mmu.c | 4 +++-
>>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
>>> index c60c5da..bc8302f 100644
>>> --- a/arch/x86/kvm/mmu.c
>>> +++ b/arch/x86/kvm/mmu.c
>>> @@ -4385,8 +4385,10 @@ void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm)
>>> * The max value is MMIO_MAX_GEN - 1 since it is not called
>>> * when mark memslot invalid.
>>> */
>>> - if (unlikely(kvm_current_mmio_generation(kvm) >= (MMIO_MAX_GEN - 1)))
>>> + if (unlikely(kvm_current_mmio_generation(kvm) >= (MMIO_MAX_GEN - 1))) {
>>> + printk(KERN_INFO "kvm: zapping shadow pages for mmio generation wraparound");
>>
>> This should at least be rate-limited, because it is guest triggerable.
>>
> It will be hard for guest to triggers it 1 << 19 times too fast though.
>
>> But why isn't the kvm_mmu_invalidate_zap_all_pages tracepoint enough?
>
> This one will trigger during slot deletion/move too.
>
> I would put it in to see if it actually triggers in some real world
> workloads (skipping the firs wraparound since it is intentional),
> we can always drop it if it will turn out to create a lot of noise.
Reading a ROM in a loop can trigger it in less than 5 minutes on my
machine. Not a lot of noise, but enough to be annoying. I think the
existing tracepoint is enough, or we can add a more specific one here.
Paolo
next prev parent reply other threads:[~2013-06-20 12:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 8:59 [PATCH] KVM: MMU: Inform users of mmio generation wraparound Takuya Yoshikawa
2013-06-20 10:59 ` Paolo Bonzini
2013-06-20 11:45 ` Gleb Natapov
2013-06-20 12:28 ` Takuya Yoshikawa
2013-06-20 12:54 ` Gleb Natapov
2013-06-20 13:14 ` Paolo Bonzini
2013-06-20 14:26 ` Takuya Yoshikawa
2013-06-20 13:17 ` Takuya Yoshikawa
2013-06-20 12:35 ` Paolo Bonzini [this message]
2013-06-20 12:46 ` Gleb Natapov
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=51C2F718.1010500@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=xiaoguangrong@linux.vnet.ibm.com \
--cc=yoshikawa_takuya_b1@lab.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