[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/30] migration: Take bitmap mutex when completing ram migration
From: |
Juan Quintela |
Subject: |
[PULL 15/30] migration: Take bitmap mutex when completing ram migration |
Date: |
Tue, 15 Nov 2022 16:34:59 +0100 |
From: Peter Xu <peterx@redhat.com>
Any call to ram_find_and_save_block() needs to take the bitmap mutex. We
used to not take it for most of ram_save_complete() because we thought
we're the only one left using the bitmap, but it's not true after the
preempt full patchset applied, since the return path can be taking it too.
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/ram.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/migration/ram.c b/migration/ram.c
index 2fcce796d0..96fa521813 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3434,6 +3434,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
/* try transferring iterative blocks of memory */
/* flush all remaining blocks regardless of rate limiting */
+ qemu_mutex_lock(&rs->bitmap_mutex);
while (true) {
int pages;
@@ -3447,6 +3448,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
break;
}
}
+ qemu_mutex_unlock(&rs->bitmap_mutex);
flush_compressed_data(rs);
ram_control_after_iterate(f, RAM_CONTROL_FINISH);
--
2.38.1
- [PULL 07/30] migration: Export ram_release_page(), (continued)
- [PULL 07/30] migration: Export ram_release_page(), Juan Quintela, 2022/11/15
- [PULL 03/30] migration: check magic value for deciding the mapping of channels, Juan Quintela, 2022/11/15
- [PULL 04/30] multifd: Create page_size fields into both MultiFD{Recv, Send}Params, Juan Quintela, 2022/11/15
- [PULL 06/30] migration: Export ram_transferred_ram(), Juan Quintela, 2022/11/15
- [PULL 05/30] multifd: Create page_count fields into both MultiFD{Recv, Send}Params, Juan Quintela, 2022/11/15
- [PULL 09/30] Unit test code and benchmark code, Juan Quintela, 2022/11/15
- [PULL 13/30] migration: Use non-atomic ops for clear log bitmap, Juan Quintela, 2022/11/15
- [PULL 12/30] migration: Disallow postcopy preempt to be used with compress, Juan Quintela, 2022/11/15
- [PULL 11/30] migration: Fix race on qemu_file_shutdown(), Juan Quintela, 2022/11/15
- [PULL 14/30] migration: Disable multifd explicitly with compression, Juan Quintela, 2022/11/15
- [PULL 15/30] migration: Take bitmap mutex when completing ram migration,
Juan Quintela <=
- [PULL 16/30] migration: Add postcopy_preempt_active(), Juan Quintela, 2022/11/15
- [PULL 20/30] migration: Yield bitmap_mutex properly when sending/sleeping, Juan Quintela, 2022/11/15
- [PULL 21/30] migration: Use atomic ops properly for page accountings, Juan Quintela, 2022/11/15
- [PULL 23/30] migration: Introduce pss_channel, Juan Quintela, 2022/11/15
- [PULL 19/30] migration: Remove RAMState.f references in compression code, Juan Quintela, 2022/11/15
- [PULL 17/30] migration: Cleanup xbzrle zero page cache update logic, Juan Quintela, 2022/11/15
- [PULL 18/30] migration: Trivial cleanup save_page_header() on same block check, Juan Quintela, 2022/11/15
- [PULL 24/30] migration: Add pss_init(), Juan Quintela, 2022/11/15
- [PULL 25/30] migration: Make PageSearchStatus part of RAMState, Juan Quintela, 2022/11/15
- [PULL 22/30] migration: Teach PSS about host page, Juan Quintela, 2022/11/15