[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migratio
From: |
Peter Xu |
Subject: |
Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy) |
Date: |
Wed, 13 Oct 2021 14:26:43 +0800 |
On Sat, Oct 09, 2021 at 04:56:13AM -0300, Leonardo Bras wrote:
> @@ -105,7 +105,13 @@ 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);
> + int flags = 0;
> +
> + if (migrate_multifd_zerocopy()) {
> + flags = QIO_CHANNEL_WRITE_FLAG_ZEROCOPY;
> + }
> +
> + return qio_channel_writev_all_flags(p->c, p->pages->iov, used, flags,
> errp);
> }
What if the user specified ZEROCOPY+MULTIFD, but the kernel doesn't support it?
IIUC then the first call to qio_channel_writev_all_flags() above will fail,
then we fail the migration.
It seems fine, but since you've introduced QIO_CHANNEL_FEATURE_WRITE_ZEROCOPY
in the previous patch - I think the cleaner way is when start migration and
after we setup the ioc, we sanity check on the capability and the ioc to make
sure if ZEROCOPY+MULTIFD is specified, we should fail early if we're sure the
ioc doesn't have QIO_CHANNEL_FEATURE_WRITE_ZEROCOPY bit set?
--
Peter Xu
- [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy), (continued)
- [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy), Leonardo Bras, 2021/10/09
- Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy), Eric Blake, 2021/10/11
- Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy), Leonardo Bras Soares Passos, 2021/10/11
- Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy), Markus Armbruster, 2021/10/12
- Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy), Leonardo Bras Soares Passos, 2021/10/27
- Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy), Markus Armbruster, 2021/10/28
- Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy), Leonardo Bras Soares Passos, 2021/10/28
Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy), Peter Xu, 2021/10/13
Re: [PATCH v4 3/3] multifd: Implement zerocopy write in multifd migration (multifd-zerocopy),
Peter Xu <=