aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Straub <lukasstraub2@web.de>2023-05-08 21:10:55 +0200
committerJuan Quintela <quintela@redhat.com>2023-05-10 18:48:11 +0200
commit9d638407efa44153c5269f04e5010b105f5daac9 (patch)
tree75cf3f9f17fe170f59b5c1baf34dc5b73e0b3902
parent871cfc540014bb2292d79ce4348484a3dbb33034 (diff)
downloadqemu-9d638407efa44153c5269f04e5010b105f5daac9.zip
qemu-9d638407efa44153c5269f04e5010b105f5daac9.tar.gz
qemu-9d638407efa44153c5269f04e5010b105f5daac9.tar.bz2
ram: Let colo_flush_ram_cache take the bitmap_mutex
This is not required, colo_flush_ram_cache does not run concurrently with the multifd threads since the cache is only flushed after everything has been received. But it makes me more comfortable. This will be used in the next commits to add colo support to multifd. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <35cb23ba854151d38a31e3a5c8a1020e4283cb4a.1683572883.git.lukasstraub2@web.de> Signed-off-by: Juan Quintela <quintela@redhat.com>
-rw-r--r--migration/ram.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/migration/ram.c b/migration/ram.c
index b5d03f8..f69d8d4 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3814,6 +3814,7 @@ void colo_flush_ram_cache(void)
unsigned long offset = 0;
memory_global_dirty_log_sync();
+ qemu_mutex_lock(&ram_state->bitmap_mutex);
WITH_RCU_READ_LOCK_GUARD() {
RAMBLOCK_FOREACH_NOT_IGNORED(block) {
ramblock_sync_dirty_bitmap(ram_state, block);
@@ -3848,6 +3849,7 @@ void colo_flush_ram_cache(void)
}
}
}
+ qemu_mutex_unlock(&ram_state->bitmap_mutex);
trace_colo_flush_ram_cache_end();
}