From: peterx@redhat.com
To: qemu-devel@nongnu.org
Cc: "Fabiano Rosas" <farosas@suse.de>,
"Daniel P . Berrangé" <berrange@redhat.com>,
peterx@redhat.com
Subject: [PULL 3/3] migration/multifd: Fix clearing of mapped-ram zero pages
Date: Fri, 22 Mar 2024 12:14:17 -0400 [thread overview]
Message-ID: <20240322161417.759586-4-peterx@redhat.com> (raw)
In-Reply-To: <20240322161417.759586-1-peterx@redhat.com>
From: Fabiano Rosas <farosas@suse.de>
When the zero page detection is done in the multifd threads, we need
to iterate the second part of the pages->offset array and clear the
file bitmap for each zero page. The piece of code we merged to do that
is wrong.
The reason this has passed all the tests is because the bitmap is
initialized with zeroes already, so clearing the bits only really has
an effect during live migration and when a data page goes from having
data to no data.
Fixes: 303e6f54f9 ("migration/multifd: Implement zero page transmission on the multifd thread.")
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240321201242.6009-1-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/multifd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index d2f0238f70..2802afe79d 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -111,7 +111,6 @@ void multifd_send_channel_created(void)
static void multifd_set_file_bitmap(MultiFDSendParams *p)
{
MultiFDPages_t *pages = p->pages;
- uint32_t zero_num = p->pages->num - p->pages->normal_num;
assert(pages->block);
@@ -119,7 +118,7 @@ static void multifd_set_file_bitmap(MultiFDSendParams *p)
ramblock_set_file_bmap_atomic(pages->block, pages->offset[i], true);
}
- for (int i = p->pages->num; i < zero_num; i++) {
+ for (int i = p->pages->normal_num; i < p->pages->num; i++) {
ramblock_set_file_bmap_atomic(pages->block, pages->offset[i], false);
}
}
--
2.44.0
next prev parent reply other threads:[~2024-03-22 16:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 16:14 [PULL 0/3] Migration 20240322 patches peterx
2024-03-22 16:14 ` [PULL 1/3] migration: Revert mapped-ram multifd support to fd: URI peterx
2024-03-22 16:14 ` [PULL 2/3] migration/postcopy: Fix high frequency sync peterx
2024-03-22 16:14 ` peterx [this message]
2024-03-25 16:46 ` [PULL 0/3] Migration 20240322 patches Peter Maydell
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=20240322161417.759586-4-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=qemu-devel@nongnu.org \
/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).