[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 06/11] migration: Move iov from pages to params
From: |
Juan Quintela |
Subject: |
Re: [PATCH 06/11] migration: Move iov from pages to params |
Date: |
Mon, 22 Nov 2021 10:31:10 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Richard Henderson <richard.henderson@linaro.org> wrote:
> On 11/19/21 5:58 PM, Juan Quintela wrote:
>> static int nocomp_send_prepare(MultiFDSendParams *p, uint32_t used,
>> Error **errp)
>> {
>> + MultiFDPages_t *pages = p->pages;
>> +
>> + for (int i = 0; i < used; i++) {
>> + p->iov[p->iovs_used].iov_base = pages->block->host +
>> pages->offset[i];
>> + p->iov[p->iovs_used].iov_len = qemu_target_page_size();
>> + p->iovs_used++;
>> + }
>> +
>> p->next_packet_size = used * qemu_target_page_size();
>
> Compute qemu_target_page_size once in the function.
> Hoist p->iovs_used to a local variable around the loop.
>
>> @@ -154,7 +162,11 @@ static int nocomp_recv_pages(MultiFDRecvParams *p,
>> uint32_t used, Error **errp)
>> p->id, flags, MULTIFD_FLAG_NOCOMP);
>> return -1;
>> }
>> - return qio_channel_readv_all(p->c, p->pages->iov, used, errp);
>> + for (int i = 0; i < p->pages->used; i++) {
>> + p->iov[i].iov_base = p->pages->block->host + p->pages->offset[i];
>> + p->iov[i].iov_len = qemu_target_page_size();
>> + }
>
> Similarly.
Done both.
Thank again, Juan.
- [PATCH 00/11] migration: Make multifd use only one write on the send path, Juan Quintela, 2021/11/19
- [PATCH 03/11] multifd: Fill offset and block for reception, Juan Quintela, 2021/11/19
- [PATCH 01/11] migration: Remove is_zero_range(), Juan Quintela, 2021/11/19
- [PATCH 06/11] migration: Move iov from pages to params, Juan Quintela, 2021/11/19
- [PATCH 05/11] multifd: Make zlib compression method not use iovs, Juan Quintela, 2021/11/19
- [PATCH 07/11] multifd: Make zlib use iov's, Juan Quintela, 2021/11/19
- [PATCH 04/11] multifd: Make zstd compression method not use iovs, Juan Quintela, 2021/11/19
- [PATCH 08/11] multifd: Make zstd use iov's, Juan Quintela, 2021/11/19
- [PATCH 02/11] dump: Remove is_zero_page(), Juan Quintela, 2021/11/19
- [PATCH 09/11] multifd: Remove send_write() method, Juan Quintela, 2021/11/19