[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 6/7] multifd: Send header packet without flags if zero-co
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v10 6/7] multifd: Send header packet without flags if zero-copy-send is enabled |
Date: |
Wed, 27 Apr 2022 09:44:15 +0100 |
User-agent: |
Mutt/2.1.5 (2021-12-30) |
On Tue, Apr 26, 2022 at 08:06:55PM -0300, Leonardo Bras wrote:
> Since d48c3a0445 ("multifd: Use a single writev on the send side"),
> sending the header packet and the memory pages happens in the same
> writev, which can potentially make the migration faster.
>
> Using channel-socket as example, this works well with the default copying
> mechanism of sendmsg(), but with zero-copy-send=true, it will cause
> the migration to often break.
>
> This happens because the header packet buffer gets reused quite often,
> and there is a high chance that by the time the MSG_ZEROCOPY mechanism get
> to send the buffer, it has already changed, sending the wrong data and
> causing the migration to abort.
>
> It means that, as it is, the buffer for the header packet is not suitable
> for sending with MSG_ZEROCOPY.
>
> In order to enable zero copy for multifd, send the header packet on an
> individual write(), without any flags, and the remanining pages with a
> writev(), as it was happening before. This only changes how a migration
> with zero-copy-send=true works, not changing any current behavior for
> migrations with zero-copy-send=false.
>
> Signed-off-by: Leonardo Bras <leobras@redhat.com>
> ---
> migration/multifd.c | 23 ++++++++++++++++++++---
> 1 file changed, 20 insertions(+), 3 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With 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 :|
- [PATCH v10 0/7] MSG_ZEROCOPY + multifd, Leonardo Bras, 2022/04/26
- [PATCH v10 1/7] QIOChannel: Add flags on io_writev and introduce io_flush callback, Leonardo Bras, 2022/04/26
- [PATCH v10 2/7] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX, Leonardo Bras, 2022/04/26
- [PATCH v10 3/7] migration: Add zero-copy-send parameter for QMP/HMP for Linux, Leonardo Bras, 2022/04/26
- [PATCH v10 4/7] migration: Add migrate_use_tls() helper, Leonardo Bras, 2022/04/26
- [PATCH v10 5/7] multifd: multifd_send_sync_main now returns negative on error, Leonardo Bras, 2022/04/26
- [PATCH v10 6/7] multifd: Send header packet without flags if zero-copy-send is enabled, Leonardo Bras, 2022/04/26
- [PATCH v10 7/7] multifd: Implement zero copy write in multifd migration (multifd-zero-copy), Leonardo Bras, 2022/04/26
- Re: [PATCH v10 0/7] MSG_ZEROCOPY + multifd, Dr. David Alan Gilbert, 2022/04/28