[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 05/34] migration/multifd: Release recv sem_sync earlier
From: |
Fabiano Rosas |
Subject: |
[PATCH v4 05/34] migration/multifd: Release recv sem_sync earlier |
Date: |
Tue, 20 Feb 2024 19:41:09 -0300 |
Now that multifd_recv_terminate_threads() is called only once, release
the recv side sem_sync earlier like we do for the send side.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
migration/multifd.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index fba00b9e8f..43f0820996 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -1104,6 +1104,12 @@ static void multifd_recv_terminate_threads(Error *err)
for (i = 0; i < migrate_multifd_channels(); i++) {
MultiFDRecvParams *p = &multifd_recv_state->params[i];
+ /*
+ * multifd_recv_thread may hung at MULTIFD_FLAG_SYNC handle code,
+ * however try to wakeup it without harm in cleanup phase.
+ */
+ qemu_sem_post(&p->sem_sync);
+
/*
* We could arrive here for two reasons:
* - normal quit, i.e. everything went fine, just finished
@@ -1162,12 +1168,6 @@ void multifd_recv_cleanup(void)
for (i = 0; i < migrate_multifd_channels(); i++) {
MultiFDRecvParams *p = &multifd_recv_state->params[i];
- /*
- * multifd_recv_thread may hung at MULTIFD_FLAG_SYNC handle code,
- * however try to wakeup it without harm in cleanup phase.
- */
- qemu_sem_post(&p->sem_sync);
-
if (p->thread_created) {
qemu_thread_join(&p->thread);
}
--
2.35.3
- [PATCH v4 00/34] migration: File based migration with multifd and fixed-ram, Fabiano Rosas, 2024/02/20
- [PATCH v4 01/34] docs/devel/migration.rst: Document the file transport, Fabiano Rosas, 2024/02/20
- [PATCH v4 02/34] tests/qtest/migration: Rename fd_proto test, Fabiano Rosas, 2024/02/20
- [PATCH v4 03/34] tests/qtest/migration: Add a fd + file test, Fabiano Rosas, 2024/02/20
- [PATCH v4 04/34] migration/multifd: Remove p->quit from recv side, Fabiano Rosas, 2024/02/20
- [PATCH v4 05/34] migration/multifd: Release recv sem_sync earlier,
Fabiano Rosas <=
- [PATCH v4 06/34] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file, Fabiano Rosas, 2024/02/20
- [PATCH v4 07/34] io: Add generic pwritev/preadv interface, Fabiano Rosas, 2024/02/20
- [PATCH v4 08/34] io: implement io_pwritev/preadv for QIOChannelFile, Fabiano Rosas, 2024/02/20
- [PATCH v4 09/34] io: fsync before closing a file channel, Fabiano Rosas, 2024/02/20
- [PATCH v4 10/34] migration/qemu-file: add utility methods for working with seekable channels, Fabiano Rosas, 2024/02/20
- [PATCH v4 11/34] migration/ram: Introduce 'fixed-ram' migration capability, Fabiano Rosas, 2024/02/20