[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/18] multifd: Protect multifd_send_sync_main() calls
From: |
Juan Quintela |
Subject: |
[PULL 14/18] multifd: Protect multifd_send_sync_main() calls |
Date: |
Thu, 27 Apr 2023 17:22:30 +0200 |
We only need to do that on the ram_save_iterate() call on sending and
on destination when we get a RAM_SAVE_FLAG_EOS.
In setup() and complete() we need to synch in both new and old cases,
so don't add a check there.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Peter Xu <peterx@redhat.com>
---
Remove the wrappers that we take out on patch 5.
---
migration/ram.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 01356f60a4..1e2414d681 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3394,9 +3394,11 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
out:
if (ret >= 0
&& migration_is_setup_or_active(migrate_get_current()->state)) {
- ret = multifd_send_sync_main(rs->pss[RAM_CHANNEL_PRECOPY].pss_channel);
- if (ret < 0) {
- return ret;
+ if (migrate_multifd_flush_after_each_section()) {
+ ret =
multifd_send_sync_main(rs->pss[RAM_CHANNEL_PRECOPY].pss_channel);
+ if (ret < 0) {
+ return ret;
+ }
}
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
@@ -4153,7 +4155,9 @@ int ram_load_postcopy(QEMUFile *f, int channel)
case RAM_SAVE_FLAG_EOS:
/* normal exit */
- multifd_recv_sync_main();
+ if (migrate_multifd_flush_after_each_section()) {
+ multifd_recv_sync_main();
+ }
break;
default:
error_report("Unknown combination of migration flags: 0x%x"
@@ -4424,7 +4428,9 @@ static int ram_load_precopy(QEMUFile *f)
break;
case RAM_SAVE_FLAG_EOS:
/* normal exit */
- multifd_recv_sync_main();
+ if (migrate_multifd_flush_after_each_section()) {
+ multifd_recv_sync_main();
+ }
break;
default:
if (flags & RAM_SAVE_FLAG_HOOK) {
--
2.40.0
- [PULL 00/18] Migration 20230427 patches, Juan Quintela, 2023/04/27
- [PULL 04/18] migration: Create migrate_downtime_limit() function, Juan Quintela, 2023/04/27
- [PULL 10/18] migration: Create migrate_tls_hostname() function, Juan Quintela, 2023/04/27
- [PULL 06/18] migration: Move block_cleanup_parameters() to options.c, Juan Quintela, 2023/04/27
- [PULL 01/18] multifd: Fix the number of channels ready, Juan Quintela, 2023/04/27
- [PULL 17/18] migration: Make dirty_pages_rate atomic, Juan Quintela, 2023/04/27
- [PULL 14/18] multifd: Protect multifd_send_sync_main() calls,
Juan Quintela <=
- [PULL 13/18] multifd: Create property multifd-flush-after-each-section, Juan Quintela, 2023/04/27
- [PULL 05/18] migration: Move migrate_set_block_incremental() to options.c, Juan Quintela, 2023/04/27
- [PULL 16/18] stat64: Add stat64_set() operation, Juan Quintela, 2023/04/27
- [PULL 18/18] migration: Make dirty_bytes_last_sync atomic, Juan Quintela, 2023/04/27
- [PULL 07/18] migration: Remove MigrationState from block_cleanup_parameters(), Juan Quintela, 2023/04/27
- [PULL 08/18] migration: Create migrate_tls_creds() function, Juan Quintela, 2023/04/27
- [PULL 15/18] multifd: Only flush once each full round of memory, Juan Quintela, 2023/04/27
- [PULL 11/18] migration: Create migrate_block_bitmap_mapping() function, Juan Quintela, 2023/04/27
- [PULL 09/18] migration: Create migrate_tls_authz() function, Juan Quintela, 2023/04/27
- [PULL 02/18] migration: Create migrate_params_init() function, Juan Quintela, 2023/04/27