summary refs log tree commit diff stats
path: root/migration/ram.c
diff options
context:
space:
mode:
authorHyman Huang <yong.huang@smartx.com>2024-10-17 14:42:54 +0800
committerPeter Xu <peterx@redhat.com>2024-10-31 15:48:18 -0400
commit52ac968ab28b2e1eee2e083f19f2a70fdece5a2e (patch)
tree9ccd48373aeb80ad9c269d5c41dac8f5459d2ff3 /migration/ram.c
parent6a39ba7cab67da05b91e215142ce5781e77e5d9f (diff)
downloadfocaccia-qemu-52ac968ab28b2e1eee2e083f19f2a70fdece5a2e.tar.gz
focaccia-qemu-52ac968ab28b2e1eee2e083f19f2a70fdece5a2e.zip
migration: Support periodic RAMBlock dirty bitmap sync
When VM is configured with huge memory, the current throttle logic
doesn't look like to scale, because migration_trigger_throttle()
is only called for each iteration, so it won't be invoked for a long
time if one iteration can take a long time.

The periodic dirty sync aims to fix the above issue by synchronizing
the ramblock from remote dirty bitmap and, when necessary, triggering
the CPU throttle multiple times during a long iteration.

This is a trade-off between synchronization overhead and CPU throttle
impact.

Signed-off-by: Hyman Huang <yong.huang@smartx.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/f61f1b3653f2acf026901103e1c73d157d38b08f.1729146786.git.yong.huang@smartx.com
[peterx: make prev_cnt global, and reset for each migration]
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/ram.c')
-rw-r--r--migration/ram.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/migration/ram.c b/migration/ram.c
index 04fd805901..b24e45442c 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1088,7 +1088,7 @@ static void migration_bitmap_sync(RAMState *rs, bool last_stage)
     }
 }
 
-static void migration_bitmap_sync_precopy(bool last_stage)
+void migration_bitmap_sync_precopy(bool last_stage)
 {
     Error *local_err = NULL;
     assert(ram_state);