From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Li, Liang Z" <liang.z.li@intel.com>
Cc: "amit.shah@redhat.com" <amit.shah@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"zhang.zhanghailiang@huawei.com" <zhang.zhanghailiang@huawei.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"quintela@redhat.com" <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] migration: not send zero page header in ram bulk stage
Date: Mon, 18 Jan 2016 09:33:28 +0000 [thread overview]
Message-ID: <20160118093328.GA2399@work-vm> (raw)
In-Reply-To: <F2CBF3009FA73547804AE4C663CAB28E037319EA@SHSMSX101.ccr.corp.intel.com>
* Li, Liang Z (liang.z.li@intel.com) wrote:
> > * Liang Li (liang.z.li@intel.com) wrote:
> > > Now that VM's RAM pages are initialized to zero, (VM's RAM is allcated
> > > with the mmap() and MAP_ANONYMOUS option, or mmap() without
> > MAP_SHARED
> > > if hugetlbfs is used.) so there is no need to send the zero page
> > > header to destination.
> > >
> > > For guest just uses a small portions of RAM, this change can avoid
> > > allocating all the guest's RAM pages in the destination node after
> > > live migration. Another benefit is destination QEMU can save lots of
> > > CPU cycles for zero page checking.
> >
> > I think this would break postcopy, because the zero pages wouldn't be filled
> > in, so accessing them would still generate a userfault.
> > So you'd have to disable this optimisation if postcopy is enabled (even during
> > the precopy bulk stage).
> >
> > Also, are you sure about the benefits?
> > Destination guests RAM should not be allocated on receiving a zero page;
> > see ram_handle_compressed, it doesn't write to the page if it's zero, so it
> > shouldn't cause an allocate. I think you're probably correct about the zero
> > page test on the destination, I wonder if we can speed that up.
> >
> > Dave
>
> I have test the performance, with a 8G guest just booted, this patch can reduce total live migration time about 10%.
> Unfortunately, Paolo said this patch would break LM in some case ....
>
> For the zero page test on the destination, if the page is really a zero page, test is faster than writing a whole page of zero.
There shouldn't be a write on the destination though; it does a check if
the page is already zero and only if it's none-zero does it do the write;
it should rarely be non-zero.
Dave
>
> Liang
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2016-01-18 9:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 9:48 [Qemu-devel] [PATCH] migration: not send zero page header in ram bulk stage Liang Li
2016-01-15 10:17 ` Hailiang Zhang
2016-01-15 10:24 ` Li, Liang Z
2016-01-18 9:01 ` Hailiang Zhang
2016-01-19 1:26 ` Li, Liang Z
2016-01-19 3:11 ` Hailiang Zhang
2016-01-19 3:17 ` Li, Liang Z
2016-01-20 9:55 ` Paolo Bonzini
2016-01-20 9:59 ` Li, Liang Z
2016-01-19 3:25 ` Hailiang Zhang
2016-01-19 3:36 ` Li, Liang Z
2016-01-15 11:39 ` Paolo Bonzini
2016-01-16 14:12 ` Li, Liang Z
2016-01-15 18:57 ` Dr. David Alan Gilbert
2016-01-16 14:25 ` Li, Liang Z
2016-01-18 9:33 ` Dr. David Alan Gilbert [this message]
2016-01-18 9:17 ` Hailiang Zhang
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=20160118093328.GA2399@work-vm \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=liang.z.li@intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=zhang.zhanghailiang@huawei.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).