[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 3/3] multifd: Send using asynchronous write on nocomp to send
From: |
Leonardo Bras |
Subject: |
[PATCH v3 3/3] multifd: Send using asynchronous write on nocomp to send RAM pages. |
Date: |
Wed, 22 Sep 2021 19:24:23 -0300 |
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);
}
/**
@@ -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);
--
2.33.0
- Re: [PATCH v3 1/3] QIOChannel: Add io_async_writev & io_async_flush callbacks, (continued)
[PATCH v3 2/3] QIOChannelSocket: Implement io_async_write & io_async_flush, Leonardo Bras, 2021/09/22
[PATCH v3 3/3] multifd: Send using asynchronous write on nocomp to send RAM pages.,
Leonardo Bras <=
Re: [PATCH v3 0/3] QIOChannel async_write & async_flush + MSG_ZEROCOPY + multifd, Peter Xu, 2021/09/28