[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/30] migration/multifd: clean pages after filling packet
From: |
Juan Quintela |
Subject: |
[PULL 21/30] migration/multifd: clean pages after filling packet |
Date: |
Tue, 14 Jan 2020 12:39:17 +0100 |
From: Wei Yang <address@hidden>
This is a preparation for the next patch:
not use multifd during postcopy.
Without enabling postcopy, everything looks good. While after enabling
postcopy, migration may fail even not use multifd during postcopy. The
reason is the pages is not properly cleared and *old* target page will
continue to be transferred.
After clean pages, migration succeeds.
Signed-off-by: Wei Yang <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/ram.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 5f20c3d15d..a05448c0c9 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -955,10 +955,10 @@ static int multifd_send_pages(RAMState *rs)
}
qemu_mutex_unlock(&p->mutex);
}
- p->pages->used = 0;
+ assert(!p->pages->used);
+ assert(!p->pages->block);
p->packet_num = multifd_send_state->packet_num++;
- p->pages->block = NULL;
multifd_send_state->pages = p->pages;
p->pages = pages;
transferred = ((uint64_t) pages->used) * TARGET_PAGE_SIZE + p->packet_len;
@@ -1154,6 +1154,8 @@ static void *multifd_send_thread(void *opaque)
p->flags = 0;
p->num_packets++;
p->num_pages += used;
+ p->pages->used = 0;
+ p->pages->block = NULL;
qemu_mutex_unlock(&p->mutex);
trace_multifd_send(p->id, packet_num, used, flags,
--
2.24.1
- [PULL 12/30] migration: add savevm_state_handler_remove(), (continued)
- [PULL 12/30] migration: add savevm_state_handler_remove(), Juan Quintela, 2020/01/14
- [PULL 11/30] misc: use QEMU_IS_ALIGNED, Juan Quintela, 2020/01/14
- [PULL 13/30] migration: savevm_state_handler_insert: constant-time element insertion, Juan Quintela, 2020/01/14
- [PULL 14/30] migration/ram: Yield periodically to the main loop, Juan Quintela, 2020/01/14
- [PULL 15/30] migration/postcopy: reduce memset when it is zero page and matches_target_page_size, Juan Quintela, 2020/01/14
- [PULL 16/30] migration/postcopy: wait for decompress thread in precopy, Juan Quintela, 2020/01/14
- [PULL 17/30] migration/postcopy: count target page number to decide the place_needed, Juan Quintela, 2020/01/14
- [PULL 18/30] migration/postcopy: set all_zero to true on the first target page, Juan Quintela, 2020/01/14
- [PULL 19/30] migration/postcopy: enable random order target page arrival, Juan Quintela, 2020/01/14
- [PULL 20/30] migration/postcopy: enable compress during postcopy, Juan Quintela, 2020/01/14
- [PULL 21/30] migration/multifd: clean pages after filling packet,
Juan Quintela <=
- [PULL 22/30] migration/multifd: not use multifd during postcopy, Juan Quintela, 2020/01/14
- [PULL 23/30] migration/multifd: fix nullptr access in terminating multifd threads, Juan Quintela, 2020/01/14
- [PULL 24/30] migration/multifd: fix destroyed mutex access in terminating multifd threads, Juan Quintela, 2020/01/14
- [PULL 25/30] Bug #1829242 correction., Juan Quintela, 2020/01/14
- [PULL 26/30] migration: Define VMSTATE_INSTANCE_ID_ANY, Juan Quintela, 2020/01/14
- [PULL 27/30] migration: Change SaveStateEntry.instance_id into uint32_t, Juan Quintela, 2020/01/14
- [PULL 28/30] apic: Use 32bit APIC ID for migration instance ID, Juan Quintela, 2020/01/14
- [PULL 29/30] migration: Support QLIST migration, Juan Quintela, 2020/01/14
- [PULL 30/30] multifd: Allocate uint64_t instead of ram_addr_t, Juan Quintela, 2020/01/14