From: Peter Xu <peterx@redhat.com>
To: yong.huang@smartx.com
Cc: qemu-devel <qemu-devel@nongnu.org>, Fabiano Rosas <farosas@suse.de>
Subject: Re: [PATCH] multifd: Make the main thread yield periodically to the main loop
Date: Fri, 8 Aug 2025 11:42:03 -0400 [thread overview]
Message-ID: <aJYay1BNkq8fiTVf@x1.local> (raw)
In-Reply-To: <5512220e1005ae2bc7357b2def32639d164e84eb.1754534263.git.yong.huang@smartx.com>
On Thu, Aug 07, 2025 at 10:41:17AM +0800, yong.huang@smartx.com wrote:
> diff --git a/migration/multifd.c b/migration/multifd.c
> index b255778855..aca0aeb341 100644
> --- a/migration/multifd.c
> +++ b/migration/multifd.c
> @@ -1228,6 +1228,16 @@ void multifd_recv_sync_main(void)
> }
> }
> trace_multifd_recv_sync_main_signal(p->id);
> + do {
> + if (qemu_sem_timedwait(&multifd_recv_state->sem_sync, 10000) == 0) {
> + break;
> + }
> + if (qemu_in_coroutine()) {
> + aio_co_schedule(qemu_get_current_aio_context(),
> + qemu_coroutine_self());
> + qemu_coroutine_yield();
> + }
> + } while (1);
I still think either yank or fixing migrate_cancel is the way to go, but
when staring at this change.. I don't think I understand this patch at all.
It timedwait()s on the sem_sync that we just consumed. Do you at least
need to remove the ones above this piece of code to not hang forever?
for (i = 0; i < thread_count; i++) {
trace_multifd_recv_sync_main_wait(i);
qemu_sem_wait(&multifd_recv_state->sem_sync);
}
> qemu_sem_post(&p->sem_sync);
> }
> trace_multifd_recv_sync_main(multifd_recv_state->packet_num);
> --
> 2.27.0
>
--
Peter Xu
next prev parent reply other threads:[~2025-08-08 15:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-07 2:41 [PATCH] multifd: Make the main thread yield periodically to the main loop yong.huang
2025-08-07 9:32 ` Lukas Straub
2025-08-07 9:36 ` Lukas Straub
2025-08-08 2:36 ` Yong Huang
2025-08-08 7:01 ` Lukas Straub
2025-08-08 8:02 ` Yong Huang
2025-08-08 13:55 ` Fabiano Rosas
2025-08-08 15:37 ` Peter Xu
2025-08-11 2:25 ` Yong Huang
2025-08-11 7:03 ` Lukas Straub
2025-08-11 13:53 ` Fabiano Rosas
2025-08-19 10:31 ` Daniel P. Berrangé
2025-08-19 12:03 ` Lukas Straub
2025-08-19 12:07 ` Daniel P. Berrangé
2025-08-19 20:03 ` Peter Xu
2025-08-11 2:27 ` Yong Huang
2025-08-08 6:36 ` Yong Huang
2025-08-08 15:42 ` Peter Xu [this message]
2025-08-11 2:02 ` Yong Huang
2025-08-19 10:19 ` Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aJYay1BNkq8fiTVf@x1.local \
--to=peterx@redhat.com \
--cc=farosas@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=yong.huang@smartx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.