public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
To: Avi Kivity <avi@redhat.com>
Cc: mtosatti@redhat.com, laijs@cn.fujitsu.com, kvm@vger.kernel.org,
	takuya.yoshikawa@gmail.com
Subject: Re: [RFC PATCH 2/2] KVM: selective write protection using dirty bitmap
Date: Fri, 19 Nov 2010 17:30:26 +0900	[thread overview]
Message-ID: <4CE635A2.2030802@oss.ntt.co.jp> (raw)
In-Reply-To: <4CE524BB.9000007@redhat.com>

(2010/11/18 22:06), Avi Kivity wrote:
> On 11/18/2010 07:15 AM, Takuya Yoshikawa wrote:

>>
>> We can also use this to selectively write protect pages to reduce unwanted page
>> faults in the future.
>>
>
> Looks like a good approach. Any measurements?
>

OK, I'll do some tests to select a right approach.

Personally, and some as a job if possible, I'm planning various things.


a) Frame buffer: small bitmap size (my hobby now)

    Performance:
      Both function level and guest side measurements is necessary. *1
      For interactivity, qemu side intelligence may be needed.
      Note: qemu side dirty bitmap optimization by Kemari team is pending now.

    Correctness:
      I doubt qemu side but I'm not good at device level VGA details yet, sorry.

    *1) I once tried to update dirty bitmap without srcu sync by using
        atomic_clear_mask() word by word. This seemed to be working and
        get_dirty_log() was not bad. But when I tested x11perf inside the guest,
        the numbers were worse than the original implementation (LOCK_PREFIX
        might do bad things to the cache and srcu reader side suffered, I guess).

        Good SRCU!


b) Live-migration: large bitmap size (my target is ~4GB RAM now)

    Performance:
      Scalability is important in both RAM size and number of dirty pages point
      of view. We need to achieve this goal without sacrificing the low workload
      case.

    Correctness:
      I'm trying to make live-migration fail in the condition of without mst's fix
      by multi threaded high work load. SMP is necessary.


>
>> +
>> + if (!(gfn_offset || (gfn % huge)))
>> + break;
>
> Why?

I preserved these lines from Lai's original.
 >> http://www.spinics.net/lists/kvm/msg35871.html

But OK, I found some duplication probably. I'll fix.


>
> wrt. O(1) write protection: hard to tell if the two methods can coexist. For direct mapped shadow pages (i.e. ep/npt) I think we can use the mask to speed up clearing of an individual sp's sptes.
>

OK, I'll test both with and without NPT.
The result may lead us to the right direction.



Takuya

      reply	other threads:[~2010-11-19  8:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18  5:12 [RFC PATCH 0/2] KVM: dirty logging optimization Takuya Yoshikawa
2010-11-18  5:14 ` [RFC PATCH 1/2] KVM: count the number of dirty bits for each memslot Takuya Yoshikawa
2010-11-18 12:54   ` Avi Kivity
2010-11-18 13:10     ` Jan Kiszka
2010-11-18 13:14       ` Avi Kivity
2010-11-18  5:15 ` [RFC PATCH 2/2] KVM: selective write protection using dirty bitmap Takuya Yoshikawa
2010-11-18 13:06   ` Avi Kivity
2010-11-19  8:30     ` Takuya Yoshikawa [this message]

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=4CE635A2.2030802@oss.ntt.co.jp \
    --to=yoshikawa.takuya@oss.ntt.co.jp \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=laijs@cn.fujitsu.com \
    --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