From: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
To: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Cc: mtosatti@redhat.com, gleb@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] KVM: MMU: Mark sp mmio cached when creating mmio spte
Date: Wed, 13 Mar 2013 15:42:18 +0800 [thread overview]
Message-ID: <51402DDA.607@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130313162816.c62899dc.yoshikawa_takuya_b1@lab.ntt.co.jp>
On 03/13/2013 03:28 PM, Takuya Yoshikawa wrote:
> On Wed, 13 Mar 2013 13:06:23 +0800
> Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> wrote:
>
>> On 03/12/2013 04:44 PM, Takuya Yoshikawa wrote:
>>> This will be used not to zap unrelated mmu pages when creating/moving
>>> a memory slot later.
>>
>> How about save all mmio spte into a mmio-rmap?
>
> The problem is that other mmu code would need to care about the pointers
> stored in the new rmap list: when mmu_shrink zaps shadow pages for example.
It is not hard... all the codes have been wrapped by *zap_spte*.
>
> Maybe worth thinking about, but I want to have a simple, back-portable patch
> for distributors, as a first step: note that creating a memory slot can happen
> many times for some guest configurations since QEMU is doing strange things
> for re-mapping some regions IIRC.
Hmm, that means also need to delete memslot frequently, this patch can not
help much on deletion case.
>
>>
>> The good things are:
>> - instead walking all shadow page, we can only walk the rmap
>
> Traversing the active list does not take such a long time compared to
> other things to do for zapping pages: us, not ms order. But I'm now
Walking shadow page depends on how much memory used on guest...
> preparing for an additional work to avoid "goto restart" after deleting
> entries. That will at least help us not to traverse more than once.
If drop the walking, so you need not care "goto" stuff anymore...
>
>> - Comparing to zap a shadow page, it does not need to flush TLB after
>> zapping mmio sptes
>
> If we check each spte in the sp, we can achieve the similar goal:
> similar to the old remove_write_access() code. I implemented such
> code but have not seen a clear improvement yet. Pros and cons will
> be there.
Checking every entries (512) in the shadow page is bad...
>
> Thanks,
> Takuya
>
>
>
next prev parent reply other threads:[~2013-03-13 7:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 8:43 [PATCH 0/2] KVM: Optimize mmio spte zapping when creating/moving memslot Takuya Yoshikawa
2013-03-12 8:44 ` [PATCH 1/2] KVM: MMU: Mark sp mmio cached when creating mmio spte Takuya Yoshikawa
2013-03-13 5:06 ` Xiao Guangrong
2013-03-13 7:28 ` Takuya Yoshikawa
2013-03-13 7:42 ` Xiao Guangrong [this message]
2013-03-13 12:33 ` Gleb Natapov
2013-03-13 12:42 ` Xiao Guangrong
2013-03-13 13:40 ` Takuya Yoshikawa
2013-03-13 14:05 ` Xiao Guangrong
2013-03-14 1:58 ` Marcelo Tosatti
2013-03-14 2:26 ` Takuya Yoshikawa
2013-03-14 2:39 ` Marcelo Tosatti
2013-03-14 5:36 ` Xiao Guangrong
2013-03-14 5:13 ` Xiao Guangrong
2013-03-14 5:45 ` Xiao Guangrong
2013-03-16 2:01 ` Takuya Yoshikawa
2013-03-12 8:45 ` [PATCH 2/2] KVM: x86: Optimize mmio spte zapping when creating/moving memslot Takuya Yoshikawa
2013-03-12 12:06 ` Gleb Natapov
2013-03-13 1:40 ` Marcelo Tosatti
2013-03-13 1:41 ` [PATCH 0/2] KVM: " Marcelo Tosatti
2013-03-14 8:23 ` 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=51402DDA.607@linux.vnet.ibm.com \
--to=xiaoguangrong@linux.vnet.ibm.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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