aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaney, Ben <bchaney@akamai.com>2025-06-16 20:56:50 +0000
committerPeter Xu <peterx@redhat.com>2025-06-23 16:03:59 -0400
commit983899eab4939dc4dff67fa4d822c5b4df7eae21 (patch)
treea1cb7daa71e27bfe114fd9f22729e3e709624631
parent430671f52669e84c176c4d3b9091b88b51f542fb (diff)
downloadqemu-983899eab4939dc4dff67fa4d822c5b4df7eae21.zip
qemu-983899eab4939dc4dff67fa4d822c5b4df7eae21.tar.gz
qemu-983899eab4939dc4dff67fa4d822c5b4df7eae21.tar.bz2
migration: Don't sync volatile memory after migration completes
Syncing volatile memory provides no benefit, instead it can cause performance issues in some cases. Only sync memory that is marked as non-volatile after migration completes on destination. Signed-off-by: Ben Chaney <bchaney@akamai.com> Fixes: bd108a44bc29 (migration: ram: Switch to ram block writeback) Link: https://lore.kernel.org/r/1CC43F59-336F-4A12-84AD-DB89E0A17A95@akamai.com Signed-off-by: Peter Xu <peterx@redhat.com>
-rw-r--r--migration/ram.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/migration/ram.c b/migration/ram.c
index fd8d83b..024d8b3 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3680,7 +3680,9 @@ static int ram_load_cleanup(void *opaque)
RAMBlock *rb;
RAMBLOCK_FOREACH_NOT_IGNORED(rb) {
- qemu_ram_block_writeback(rb);
+ if (memory_region_is_nonvolatile(rb->mr)) {
+ qemu_ram_block_writeback(rb);
+ }
}
xbzrle_load_cleanup();