qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wei Wang <wei.w.wang@intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org,
	quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com,
	liliang.opensource@gmail.com, yang.zhang.wz@gmail.com,
	quan.xu0@gmail.com, nilal@redhat.com, riel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 2/3] migration: use the free page reporting feature from balloon
Date: Thu, 08 Feb 2018 11:54:47 +0800	[thread overview]
Message-ID: <5A7BCA07.2000704@intel.com> (raw)
In-Reply-To: <20180207014345-mutt-send-email-mst@kernel.org>

On 02/07/2018 07:57 AM, Michael S. Tsirkin wrote:
> On Tue, Feb 06, 2018 at 07:08:18PM +0800, Wei Wang wrote:
>> Use the free page reporting feature from the balloon device to clear the
>> bits corresponding to guest free pages from the dirty bitmap, so that the
>> free memory are not sent.
>>
>> Signed-off-by: Wei Wang <wei.w.wang@intel.com>
>> CC: Michael S. Tsirkin <mst@redhat.com>
>> CC: Juan Quintela <quintela@redhat.com>
> What the patch seems to do is stop migration
> completely - blocking until guest completes the reporting.
>
> Which makes no sense to me, since it's just an optimization.
> Why not proceed with the migration? What do we have to loose?

If we want the optimization to run in parallel with the migration 
thread, we will need to create another polling thread, like 
multithreading compression. In that way, we will waste some host CPU. 
For example, the migration thread may proceed to send pages to the 
destination while the optimization thread is in progress, but those 
pages may turn out to be free pages (this is likely in the bulk stage) 
which don't need to be sent. In that case, why not let the migration 
thread wait a little bit (i.e. put the optimization into the migration 
thread) and proceed to do some useful things, instead of pretending to 
proceed but doing useless things?

The current plan of this patch is to skip free pages for the bulk stage 
only. I'm not sure if it would be useful for the 2nd stage onward, which 
basically relies on the dirty logging to send pages that have been 
written by the guest. For example, if the guest is not so active while 
live migration happens, there will be very few dirty bits. This 
optimization would be mostly clearing "0" bits from the dirty bitmap.


> I imagine some people might want to defer migration until reporting
> completes to reduce the load on the network. Fair enough,
> but it does not look like you actually measured the reduction
> in traffic. So I suggest you work on that as a separate feature.
>

I have the traffic data actually. Tested with 8G idle guest, Legacy v.s. 
Optimization: ~390MB v.s. ~337MB.
The legacy case has the zero page checking optimization, so the traffic 
reduction is not very obvious. But zero checking has much more overhead, 
which is demonstrated by the migration time (this optimization takes 
~14% of the legacy migration time).


Best,
Wei

  reply	other threads:[~2018-02-08  3:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 11:08 [Qemu-devel] [PATCH v2 0/3] virtio-balloon: free page hint reporting support Wei Wang
2018-02-06 11:08 ` [Qemu-devel] [PATCH v2 1/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT Wei Wang
2018-02-07  1:04   ` Michael S. Tsirkin
2018-03-02  9:32     ` Wei Wang
2018-02-09 12:06   ` Dr. David Alan Gilbert
2018-02-06 11:08 ` [Qemu-devel] [PATCH v2 2/3] migration: use the free page reporting feature from balloon Wei Wang
2018-02-06 23:57   ` Michael S. Tsirkin
2018-02-08  3:54     ` Wei Wang [this message]
2018-02-09 11:50   ` Dr. David Alan Gilbert
2018-02-26  5:07     ` Wei Wang
2018-02-26  9:22       ` Wang, Wei W
2018-02-06 11:08 ` [Qemu-devel] [PATCH v2 3/3] virtio-balloon: add a timer to limit the free page report waiting time Wei Wang
2018-02-06 23:43   ` Michael S. Tsirkin
2018-02-09 12:15   ` Dr. David Alan Gilbert
2018-02-26  4:35     ` Wei Wang
2018-02-27  0:50       ` Michael S. Tsirkin
2018-02-27 10:10         ` Wei Wang
2018-02-27 13:08           ` Liang Li
2018-02-28 10:33             ` Wei Wang
2018-02-27 10:34       ` Dr. David Alan Gilbert
2018-02-28 10:37         ` Wei Wang
2018-02-07  0:02 ` [Qemu-devel] [PATCH v2 0/3] virtio-balloon: free page hint reporting support Michael S. Tsirkin
2018-02-08  5:38   ` Wei Wang
2018-02-08 20:15 ` Dr. David Alan Gilbert
2018-02-09  3:10   ` Wei Wang
2018-02-09 10:53     ` Dr. David Alan Gilbert
2018-02-26  4:42       ` Wei Wang

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=5A7BCA07.2000704@intel.com \
    --to=wei.w.wang@intel.com \
    --cc=dgilbert@redhat.com \
    --cc=liliang.opensource@gmail.com \
    --cc=mst@redhat.com \
    --cc=nilal@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quan.xu0@gmail.com \
    --cc=quintela@redhat.com \
    --cc=riel@redhat.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=yang.zhang.wz@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).