@samitouri / QOSamiQemu / commits / 64df66fe8c

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 <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Lukas Straub <lukasstraub2@web.de> Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v11-9-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas <farosas@suse.de>

Lukas Straub committed Mar 2, 2026 at 12:43 UTC 64df66fe8caf09517a2c8168653def1020e6a95d
2 files changed +3 -3
migration/colo.c
-3
@@ -949,7 +949,4 @@ void coroutine_fn colo_incoming_co(void)
949 /* Wait checkpoint incoming thread exit before free resource */
950 qemu_thread_join(&th);
951 bql_lock();
952 -
953 - /* We hold the global BQL, so it is safe here */
954 - colo_release_ram_cache();
952 }
migration/migration.c
+3
@@ -454,6 +454,9 @@ void migration_incoming_state_destroy(void)
454 * BQL and retake unconditionally.
455 */
456 assert(bql_locked());
457 + if (migrate_colo()) {
458 + colo_release_ram_cache();
459 + }
460 qemu_loadvm_state_cleanup(mis);
461
462 if (mis->to_src_file) {