[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/30] migration: Disable multifd explicitly with compression
From: |
Juan Quintela |
Subject: |
[PATCH 14/30] migration: Disable multifd explicitly with compression |
Date: |
Tue, 15 Nov 2022 13:12:10 +0100 |
From: Peter Xu <peterx@redhat.com>
Multifd thread model does not work for compression, explicitly disable it.
Note that previuosly even we can enable both of them, nothing will go
wrong, because the compression code has higher priority so multifd feature
will just be ignored. Now we'll fail even earlier at config time so the
user should be aware of the consequence better.
Note that there can be a slight chance of breaking existing users, but
let's assume they're not majority and not serious users, or they should
have found that multifd is not working already.
With that, we can safely drop the check in ram_save_target_page() for using
multifd, because when multifd=on then compression=off, then the removed
check on save_page_use_compression() will also always return false too.
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/migration.c | 7 +++++++
migration/ram.c | 11 +++++------
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 0bc3fce4b7..9fbed8819a 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1370,6 +1370,13 @@ static bool migrate_caps_check(bool *cap_list,
}
}
+ if (cap_list[MIGRATION_CAPABILITY_MULTIFD]) {
+ if (cap_list[MIGRATION_CAPABILITY_COMPRESS]) {
+ error_setg(errp, "Multifd is not compatible with compress");
+ return false;
+ }
+ }
+
return true;
}
diff --git a/migration/ram.c b/migration/ram.c
index c0f5d6d287..2fcce796d0 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2333,13 +2333,12 @@ static int ram_save_target_page(RAMState *rs,
PageSearchStatus *pss)
}
/*
- * Do not use multifd for:
- * 1. Compression as the first page in the new block should be posted out
- * before sending the compressed page
- * 2. In postcopy as one whole host page should be placed
+ * Do not use multifd in postcopy as one whole host page should be
+ * placed. Meanwhile postcopy requires atomic update of pages, so even
+ * if host page size == guest page size the dest guest during run may
+ * still see partially copied pages which is data corruption.
*/
- if (!save_page_use_compression(rs) && migrate_use_multifd()
- && !migration_in_postcopy()) {
+ if (migrate_use_multifd() && !migration_in_postcopy()) {
return ram_save_multifd_page(rs, block, offset);
}
--
2.38.1
- [PATCH 05/30] multifd: Create page_count fields into both MultiFD{Recv, Send}Params, (continued)
- [PATCH 05/30] multifd: Create page_count fields into both MultiFD{Recv, Send}Params, Juan Quintela, 2022/11/15
- [PATCH 07/30] migration: Export ram_release_page(), Juan Quintela, 2022/11/15
- [PATCH 06/30] migration: Export ram_transferred_ram(), Juan Quintela, 2022/11/15
- [PATCH 09/30] Unit test code and benchmark code, Juan Quintela, 2022/11/15
- [PATCH 12/30] migration: Disallow postcopy preempt to be used with compress, Juan Quintela, 2022/11/15
- [PATCH 10/30] migration: Fix possible infinite loop of ram save process, Juan Quintela, 2022/11/15
- [PATCH 11/30] migration: Fix race on qemu_file_shutdown(), Juan Quintela, 2022/11/15
- [PATCH 08/30] Update AVX512 support for xbzrle_encode_buffer, Juan Quintela, 2022/11/15
- [PATCH 13/30] migration: Use non-atomic ops for clear log bitmap, Juan Quintela, 2022/11/15
- [PATCH 15/30] migration: Take bitmap mutex when completing ram migration, Juan Quintela, 2022/11/15
- [PATCH 14/30] migration: Disable multifd explicitly with compression,
Juan Quintela <=
- [PATCH 16/30] migration: Add postcopy_preempt_active(), Juan Quintela, 2022/11/15
- [PATCH 17/30] migration: Cleanup xbzrle zero page cache update logic, Juan Quintela, 2022/11/15
- [PATCH 18/30] migration: Trivial cleanup save_page_header() on same block check, Juan Quintela, 2022/11/15
- [PATCH 19/30] migration: Remove RAMState.f references in compression code, Juan Quintela, 2022/11/15
- [PATCH 20/30] migration: Yield bitmap_mutex properly when sending/sleeping, Juan Quintela, 2022/11/15
- [PATCH 22/30] migration: Teach PSS about host page, Juan Quintela, 2022/11/15
- [PATCH 21/30] migration: Use atomic ops properly for page accountings, Juan Quintela, 2022/11/15
- [PATCH 25/30] migration: Make PageSearchStatus part of RAMState, Juan Quintela, 2022/11/15
- [PATCH 23/30] migration: Introduce pss_channel, Juan Quintela, 2022/11/15
- [PATCH 24/30] migration: Add pss_init(), Juan Quintela, 2022/11/15