From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Leonardo Bras <leobras@redhat.com>
Cc: qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Peter Xu <peterx@redhat.com>, Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH v3 3/3] multifd: Send using asynchronous write on nocomp to send RAM pages.
Date: Fri, 24 Sep 2021 18:43:49 +0100 [thread overview]
Message-ID: <YU4OVZLo8oSpGrdI@redhat.com> (raw)
In-Reply-To: <20210922222423.644444-4-leobras@redhat.com>
On Wed, Sep 22, 2021 at 07:24:23PM -0300, Leonardo Bras wrote:
> Change multifd nocomp version to use asynchronous write for RAM pages, and
> benefit of MSG_ZEROCOPY when it's available.
>
> The asynchronous flush happens on cleanup only, before destroying the QIOChannel.
>
> This will work fine on RAM migration because the RAM pages are not usually freed,
> and there is no problem on changing the pages content between async_send() and
> the actual sending of the buffer, because this change will dirty the page and
> cause it to be re-sent on a next iteration anyway.
>
> Signed-off-by: Leonardo Bras <leobras@redhat.com>
> ---
> migration/multifd.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/migration/multifd.c b/migration/multifd.c
> index 377da78f5b..d247207a0a 100644
> --- a/migration/multifd.c
> +++ b/migration/multifd.c
> @@ -105,7 +105,7 @@ static int nocomp_send_prepare(MultiFDSendParams *p, uint32_t used,
> */
> static int nocomp_send_write(MultiFDSendParams *p, uint32_t used, Error **errp)
> {
> - return qio_channel_writev_all(p->c, p->pages->iov, used, errp);
> + return qio_channel_async_writev_all(p->c, p->pages->iov, used, errp);
> }
This needs to be made conditional so zeroopy is only used if rquested
by the mgmt app, and it isn't going to work in all cases (eg TLS) so
silently enabling it is not good.
>
> /**
> @@ -546,6 +546,7 @@ void multifd_save_cleanup(void)
> MultiFDSendParams *p = &multifd_send_state->params[i];
> Error *local_err = NULL;
>
> + qio_channel_async_flush(p->c, NULL);
> socket_send_channel_destroy(p->c);
> p->c = NULL;
> qemu_mutex_destroy(&p->mutex);
This isn't reliable beucase qio_channel_async_flush will return early
even if not everything is flushed.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2021-09-24 18:03 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-22 22:24 [PATCH v3 0/3] QIOChannel async_write & async_flush + MSG_ZEROCOPY + multifd Leonardo Bras
2021-09-22 22:24 ` [PATCH v3 1/3] QIOChannel: Add io_async_writev & io_async_flush callbacks Leonardo Bras
2021-09-24 17:16 ` Daniel P. Berrangé
2021-09-28 21:52 ` Peter Xu
2021-09-29 19:06 ` Leonardo Bras Soares Passos
2021-09-30 8:34 ` Daniel P. Berrangé
2021-09-29 19:03 ` Leonardo Bras Soares Passos
2021-09-22 22:24 ` [PATCH v3 2/3] QIOChannelSocket: Implement io_async_write & io_async_flush Leonardo Bras
2021-09-24 17:38 ` Daniel P. Berrangé
2021-09-29 19:32 ` Leonardo Bras Soares Passos
2021-09-30 8:39 ` Daniel P. Berrangé
2021-09-28 22:45 ` Peter Xu
2021-09-29 19:36 ` Leonardo Bras Soares Passos
2021-09-29 19:58 ` Peter Xu
2021-09-22 22:24 ` [PATCH v3 3/3] multifd: Send using asynchronous write on nocomp to send RAM pages Leonardo Bras
2021-09-24 17:43 ` Daniel P. Berrangé [this message]
2021-09-28 22:48 ` Peter Xu
2021-09-29 19:46 ` Leonardo Bras Soares Passos
2021-09-29 19:44 ` Leonardo Bras Soares Passos
2021-09-28 22:50 ` [PATCH v3 0/3] QIOChannel async_write & async_flush + MSG_ZEROCOPY + multifd Peter Xu
2021-09-29 18:34 ` Leonardo Bras Soares Passos
2021-09-29 19:22 ` Peter Xu
2021-09-29 19:48 ` Leonardo Bras Soares Passos
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=YU4OVZLo8oSpGrdI@redhat.com \
--to=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=jasowang@redhat.com \
--cc=leobras@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).