From 64df66fe8caf09517a2c8168653def1020e6a95d Mon Sep 17 00:00:00 2001 From: Lukas Straub Date: Mon, 2 Mar 2026 12:43:39 +0100 Subject: [PATCH] Call colo_release_ram_cache() after multifd threads terminate The multifd threads still may access the colo cache, so release it only after they terminate. Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v11-9-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/colo.c | 3 --- migration/migration.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index 97a224c39c..96102c9d0f 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -949,7 +949,4 @@ void coroutine_fn colo_incoming_co(void) /* Wait checkpoint incoming thread exit before free resource */ qemu_thread_join(&th); bql_lock(); - - /* We hold the global BQL, so it is safe here */ - colo_release_ram_cache(); } diff --git a/migration/migration.c b/migration/migration.c index f10abf91e2..53bf87c3fc 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -454,6 +454,9 @@ void migration_incoming_state_destroy(void) * BQL and retake unconditionally. */ assert(bql_locked()); + if (migrate_colo()) { + colo_release_ram_cache(); + } qemu_loadvm_state_cleanup(mis); if (mis->to_src_file) {