aboutsummaryrefslogtreecommitdiff
path: root/migration/multifd.c
diff options
context:
space:
mode:
authorYuan Liu <yuan1.liu@intel.com>2024-04-01 23:41:10 +0800
committerPeter Xu <peterx@redhat.com>2024-04-23 18:36:01 -0400
commit5ef7e26bdb7eda10d6d5e1b77121be9945e5e550 (patch)
tree8823bbea099cf77e06a48b8d465ff2666c9adf6a /migration/multifd.c
parentdd031677257d7d00a72f28f073befc22691a0ad6 (diff)
migration/multifd: solve zero page causing multiple page faults
Implemented recvbitmap tracking of received pages in multifd. If the zero page appears for the first time in the recvbitmap, this page is not checked and set. If the zero page has already appeared in the recvbitmap, there is no need to check the data but directly set the data to 0, because it is unlikely that the zero page will be migrated multiple times. Signed-off-by: Yuan Liu <yuan1.liu@intel.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20240401154110.2028453-2-yuan1.liu@intel.com [peterx: touch up the comment, as the bitmap is used outside postcopy now] Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/multifd.c')
-rw-r--r--migration/multifd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/migration/multifd.c b/migration/multifd.c
index 2802afe79d..f317bff077 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -277,6 +277,7 @@ static int nocomp_recv(MultiFDRecvParams *p, Error **errp)
for (int i = 0; i < p->normal_num; i++) {
p->iov[i].iov_base = p->host + p->normal[i];
p->iov[i].iov_len = p->page_size;
+ ramblock_recv_bitmap_set_offset(p->block, p->normal[i]);
}
return qio_channel_readv_all(p->c, p->iov, p->normal_num, errp);
}