[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 19/30] migration/ram: Ignore multifd flush when doing fixe
|
From: |
Fabiano Rosas |
|
Subject: |
[RFC PATCH v3 19/30] migration/ram: Ignore multifd flush when doing fixed-ram migration |
|
Date: |
Mon, 27 Nov 2023 17:26:01 -0300 |
Some functionalities of multifd are incompatible with the 'fixed-ram'
migration format.
The MULTIFD_FLUSH flag in particular is not used because in fixed-ram
there is no sinchronicity between migration source and destination so
there is not need for a sync packet. In fact, fixed-ram disables
packets in multifd as a whole.
However, we still need to sync the migration thread with the multifd
channels at key moments:
- between iterations, to avoid a slow channel being overrun by a fast
channel in the subsequent iteration;
- at ram_save_complete, to make sure all data has been transferred
before finishing migration;
Make sure RAM_SAVE_FLAG_MULTIFD_FLUSH is only emitted for fixed-ram at
those key moments.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
migration/ram.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 08604222f2..ad6abd1761 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1363,7 +1363,7 @@ static int find_dirty_block(RAMState *rs,
PageSearchStatus *pss)
pss->page = 0;
pss->block = QLIST_NEXT_RCU(pss->block, next);
if (!pss->block) {
- if (migrate_multifd() &&
+ if (migrate_multifd() && !migrate_fixed_ram() &&
!migrate_multifd_flush_after_each_section()) {
QEMUFile *f = rs->pss[RAM_CHANNEL_PRECOPY].pss_channel;
int ret = multifd_send_sync_main(f);
@@ -3112,7 +3112,8 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
return ret;
}
- if (migrate_multifd() && !migrate_multifd_flush_after_each_section()) {
+ if (migrate_multifd() && !migrate_multifd_flush_after_each_section()
+ && !migrate_fixed_ram()) {
qemu_put_be64(f, RAM_SAVE_FLAG_MULTIFD_FLUSH);
}
@@ -3242,8 +3243,11 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
out:
if (ret >= 0
&& migration_is_setup_or_active(migrate_get_current()->state)) {
- if (migrate_multifd() && migrate_multifd_flush_after_each_section()) {
- ret =
multifd_send_sync_main(rs->pss[RAM_CHANNEL_PRECOPY].pss_channel);
+ if (migrate_multifd() &&
+ (migrate_multifd_flush_after_each_section() ||
+ migrate_fixed_ram())) {
+ ret = multifd_send_sync_main(
+ rs->pss[RAM_CHANNEL_PRECOPY].pss_channel);
if (ret < 0) {
return ret;
}
--
2.35.3
- [RFC PATCH v3 10/30] tests/qtest: migration-test: Add tests for fixed-ram file-based migration, (continued)
- [RFC PATCH v3 10/30] tests/qtest: migration-test: Add tests for fixed-ram file-based migration, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 09/30] migration/ram: Add incoming 'fixed-ram' migration, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 12/30] migration/multifd: Allow QIOTask error reporting without an object, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 11/30] migration/multifd: Allow multifd without packets, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 13/30] migration/multifd: Add outgoing QIOChannelFile support, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 14/30] migration/multifd: Add incoming QIOChannelFile support, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 15/30] io: Add a pwritev/preadv version that takes a discontiguous iovec, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 16/30] multifd: Rename MultiFDSendParams::data to compress_data, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 17/30] migration/multifd: Decouple recv method from pages, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 18/30] migration/multifd: Allow receiving pages without packets, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 19/30] migration/ram: Ignore multifd flush when doing fixed-ram migration,
Fabiano Rosas <=
- [RFC PATCH v3 20/30] migration/multifd: Support outgoing fixed-ram stream format, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 21/30] migration/multifd: Support incoming fixed-ram stream format, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 22/30] tests/qtest: Add a multifd + fixed-ram migration test, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 23/30] migration: Add direct-io parameter, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 24/30] tests/qtest: Add a test for migration with direct-io and multifd, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 25/30] monitor: Honor QMP request for fd removal immediately, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 26/30] monitor: Extract fdset fd flags comparison into a function, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 27/30] monitor: fdset: Match against O_DIRECT, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 28/30] docs/devel/migration.rst: Document the file transport, Fabiano Rosas, 2023/11/27
- [RFC PATCH v3 30/30] tests/qtest: Add a test for fixed-ram with passing of fds, Fabiano Rosas, 2023/11/27