[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/6] ram: Let colo_flush_ram_cache take the bitmap_mutex
|
From: |
Lukas Straub |
|
Subject: |
[PATCH v2 2/6] ram: Let colo_flush_ram_cache take the bitmap_mutex |
|
Date: |
Mon, 8 May 2023 21:10:55 +0200 |
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>
---
migration/ram.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/migration/ram.c b/migration/ram.c
index 2d3fd2112a..f9e7aeda12 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -4230,6 +4230,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);
@@ -4264,6 +4265,7 @@ void colo_flush_ram_cache(void)
}
}
}
+ qemu_mutex_unlock(&ram_state->bitmap_mutex);
trace_colo_flush_ram_cache_end();
}
--
2.39.2
pgpbB8DUaWUHD.pgp
Description: OpenPGP digital signature
- [PATCH v2 0/6] multifd: Add colo support, Lukas Straub, 2023/05/08
- [PATCH v2 1/6] ram: Add public helper to set colo bitmap, Lukas Straub, 2023/05/08
- [PATCH v2 2/6] ram: Let colo_flush_ram_cache take the bitmap_mutex,
Lukas Straub <=
- [PATCH v2 3/6] multifd: Introduce multifd-internal.h, Lukas Straub, 2023/05/08
- [PATCH v2 4/6] multifd: Introduce a overridable revc_pages method, Lukas Straub, 2023/05/08
- [PATCH v2 5/6] multifd: Add the ramblock to MultiFDRecvParams, Lukas Straub, 2023/05/08
- [PATCH v2 6/6] multifd: Add colo support, Lukas Straub, 2023/05/08