From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "owasserm@redhat.com" <owasserm@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"quintela@redhat.com" <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Fix two XBZRLE corruption issues
Date: Fri, 14 Feb 2014 09:35:14 +0000 [thread overview]
Message-ID: <20140214093514.GB2316@work-vm> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020815C26F8@SZXEMA503-MBS.china.huawei.com>
* Gonglei (Arei) (arei.gonglei@huawei.com) wrote:
>
> Best regards,
> -Gonglei
>
>
<snip>
> > } else if (!ram_bulk_stage && migrate_use_xbzrle()) {
> > - current_addr = block->offset + offset;
> > bytes_sent = save_xbzrle_page(f, p, current_addr, block,
> > offset, cont,
> > last_stage);
> > if (!last_stage) {
> > + /* We must send exactly what's in the xbzrle cache
> > + * even if the page wasn't xbzrle compressed, so
> > that
> > + * it's right next time.
> > + */
> > p = get_cached_data(XBZRLE.cache, current_addr);
> > +
> > + /* Can't send this cached data async, since the cache
> > page
> > + * might get updated before it gets to the wire
> > + */
> > + send_async = false;
> > }
> > }
> >
> > /* XBZRLE overflow or normal page */
> > if (bytes_sent == -1) {
> > bytes_sent = save_block_hdr(f, block, offset, cont,
> > RAM_SAVE_FLAG_PAGE);
> > - qemu_put_buffer_async(f, p, TARGET_PAGE_SIZE);
> > + if (send_async) {
> > + qemu_put_buffer_async(f, p, TARGET_PAGE_SIZE);
> > + } else {
> > + qemu_put_buffer(f, p, TARGET_PAGE_SIZE);
> > + }
> > bytes_sent += TARGET_PAGE_SIZE;
> > acct_info.norm_pages++;
> > }
>
> if a page that was cached by XBZRLE but XBZRLE overflow,qemu should send the page in the cache rather then original page.Because the original page might change .
Which it already does - see the line above which is:
p = get_cached_data(XBZRLE.cache, current_addr);
That changes the 'p' to point to the page in the cache and thus forces that
qemu_put_buffer to send the page in the cache; my patch doesn't change that,
it just stops it using the qemu_put_buffer_async so that the cache is read
immediately not at some point in the future when the cache may have changed.
Dave
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2014-02-14 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 19:44 [Qemu-devel] [PATCH] Fix two XBZRLE corruption issues Dr. David Alan Gilbert (git)
2014-02-14 9:32 ` Gonglei (Arei)
2014-02-14 9:35 ` Dr. David Alan Gilbert [this message]
2014-02-14 9:49 ` Gonglei (Arei)
2014-02-14 9:52 ` Orit Wasserman
2014-02-18 16:55 ` Juan Quintela
2014-02-18 20:35 ` Dr. David Alan Gilbert
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=20140214093514.GB2316@work-vm \
--to=dgilbert@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=owasserm@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.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).