From: Juan Quintela <quintela@redhat.com>
To: Li Zhang <lizhang@suse.de>
Cc: dgilbert@redhat.com, cfontana@suse.de, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/2] multifd: cleanup the function multifd_send_thread
Date: Wed, 08 Feb 2023 19:11:25 +0100 [thread overview]
Message-ID: <87o7q4hvsi.fsf@secure.mitica> (raw)
In-Reply-To: <20211222113049.9326-3-lizhang@suse.de> (Li Zhang's message of "Wed, 22 Dec 2021 12:30:49 +0100")
Li Zhang <lizhang@suse.de> wrote:
> Cleanup multifd_send_thread
>
> Signed-off-by: Li Zhang <lizhang@suse.de>
Hi Zhang
First of all, sorry for the late review.
This other patch is wrong.
> ---
> migration/multifd.c | 82 ++++++++++++++++++++++-----------------------
> 1 file changed, 41 insertions(+), 41 deletions(-)
>
> diff --git a/migration/multifd.c b/migration/multifd.c
> index 4ec40739e0..7888d71bfe 100644
> --- a/migration/multifd.c
> +++ b/migration/multifd.c
> @@ -649,58 +649,58 @@ static void *multifd_send_thread(void *opaque)
> break;
> }
> qemu_mutex_lock(&p->mutex);
> -
> - if (p->pending_job) {
> - uint32_t used = p->pages->num;
> - uint64_t packet_num = p->packet_num;
> - uint32_t flags = p->flags;
> -
> - if (used) {
> - ret = multifd_send_state->ops->send_prepare(p, &local_err);
> - if (ret != 0) {
> - qemu_mutex_unlock(&p->mutex);
> - break;
> - }
> - }
> - multifd_send_fill_packet(p);
> - p->flags = 0;
> - p->num_packets++;
> - p->num_pages += used;
> - p->pages->num = 0;
> - p->pages->block = NULL;
> + if (!p->quit && !p->pending_job) {
> + /* sometimes there are spurious wakeups */
> + qemu_mutex_unlock(&p->mutex);
> + continue;
> + } else if (!p->pending_job) {
Here it should be
} else if (p->quit) {
And in this case, I preffer the previous code, as the first case is the
common one.
I still have to see if we ever enter through the spurious case anymore.
Thanks, Juan.
prev parent reply other threads:[~2023-02-08 18:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 11:30 [PATCH 0/2] multifd: cleanup some source code Li Zhang
2021-12-22 11:30 ` [PATCH 1/2] multifd: cleanup the function multifd_channel_connect Li Zhang
2022-01-06 10:07 ` Li Zhang
2023-02-08 17:59 ` Juan Quintela
2021-12-22 11:30 ` [PATCH 2/2] multifd: cleanup the function multifd_send_thread Li Zhang
2022-01-06 10:07 ` Li Zhang
2023-02-08 18:11 ` Juan Quintela [this message]
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=87o7q4hvsi.fsf@secure.mitica \
--to=quintela@redhat.com \
--cc=cfontana@suse.de \
--cc=dgilbert@redhat.com \
--cc=lizhang@suse.de \
--cc=qemu-devel@nongnu.org \
/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.