[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 14/23] migration/multifd: Forbid spurious wakeups
From: |
peterx |
Subject: |
[PATCH v2 14/23] migration/multifd: Forbid spurious wakeups |
Date: |
Fri, 2 Feb 2024 18:28:48 +0800 |
From: Peter Xu <peterx@redhat.com>
Now multifd's logic is designed to have no spurious wakeup. I still
remember a talk to Juan and he seems to agree we should drop it now, and if
my memory was right it was there because multifd used to hit that when
still debugging.
Let's drop it and see what can explode; as long as it's not reaching
soft-freeze.
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/multifd.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index 6aa44340de..28b54100cd 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -756,7 +756,9 @@ static void *multifd_send_thread(void *opaque)
p->next_packet_size = 0;
qatomic_set(&p->pending_job, false);
qemu_mutex_unlock(&p->mutex);
- } else if (qatomic_read(&p->pending_sync)) {
+ } else {
+ /* If not a normal job, must be a sync request */
+ assert(qatomic_read(&p->pending_sync));
p->flags = MULTIFD_FLAG_SYNC;
multifd_send_fill_packet(p);
ret = qio_channel_write_all(p->c, (void *)p->packet,
@@ -771,9 +773,6 @@ static void *multifd_send_thread(void *opaque)
qatomic_set(&p->pending_sync, false);
qemu_mutex_unlock(&p->mutex);
qemu_sem_post(&p->sem_sync);
- } else {
- qemu_mutex_unlock(&p->mutex);
- /* sometimes there are spurious wakeups */
}
}
--
2.43.0
- Re: [PATCH v2 06/23] migration/multifd: Separate SYNC request with normal jobs, (continued)
- [PATCH v2 07/23] migration/multifd: Simplify locking in sender thread, peterx, 2024/02/02
- [PATCH v2 08/23] migration/multifd: Drop pages->num check in sender thread, peterx, 2024/02/02
- [PATCH v2 09/23] migration/multifd: Rename p->num_packets and clean it up, peterx, 2024/02/02
- [PATCH v2 10/23] migration/multifd: Move total_normal_pages accounting, peterx, 2024/02/02
- [PATCH v2 11/23] migration/multifd: Move trace_multifd_send|recv(), peterx, 2024/02/02
- [PATCH v2 13/23] migration/multifd: Move header prepare/fill into send_prepare(), peterx, 2024/02/02
- [PATCH v2 12/23] migration/multifd: multifd_send_prepare_header(), peterx, 2024/02/02
- [PATCH v2 14/23] migration/multifd: Forbid spurious wakeups,
peterx <=
- [PATCH v2 15/23] migration/multifd: Split multifd_send_terminate_threads(), peterx, 2024/02/02
- [PATCH v2 17/23] migration/multifd: Change retval of multifd_send_pages(), peterx, 2024/02/02
- [PATCH v2 16/23] migration/multifd: Change retval of multifd_queue_page(), peterx, 2024/02/02
- [PATCH v2 18/23] migration/multifd: Rewrite multifd_queue_page(), peterx, 2024/02/02
- [PATCH v2 19/23] migration/multifd: Cleanup multifd_save_cleanup(), peterx, 2024/02/02