[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 08/23] multifd: Move iov from pages to params
|
From: |
Juan Quintela |
|
Subject: |
Re: [PATCH v4 08/23] multifd: Move iov from pages to params |
|
Date: |
Tue, 25 Jan 2022 10:31:01 +0100 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
"Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> * Juan Quintela (quintela@redhat.com) wrote:
>> This will allow us to reduce the number of system calls on the next patch.
>>
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>> migration/multifd.h | 8 ++++++--
>> migration/multifd.c | 34 ++++++++++++++++++++++++----------
>> 2 files changed, 30 insertions(+), 12 deletions(-)
>>
>> diff --git a/migration/multifd.h b/migration/multifd.h
>> index e57adc783b..c3f18af364 100644
>> --- a/migration/multifd.h
>> +++ b/migration/multifd.h
>> @@ -62,8 +62,6 @@ typedef struct {
>> uint64_t packet_num;
>> /* offset of each page */
>> ram_addr_t *offset;
>> - /* pointer to each page */
>> - struct iovec *iov;
>> RAMBlock *block;
>> } MultiFDPages_t;
>>
>> @@ -110,6 +108,10 @@ typedef struct {
>> uint64_t num_pages;
>> /* syncs main thread and channels */
>> QemuSemaphore sem_sync;
>> + /* buffers to send */
>> + struct iovec *iov;
>> + /* number of iovs used */
>> + uint32_t iovs_num;
>> /* used for compression methods */
>> void *data;
>> } MultiFDSendParams;
>> @@ -149,6 +151,8 @@ typedef struct {
>> uint64_t num_pages;
>> /* syncs main thread and channels */
>> QemuSemaphore sem_sync;
>> + /* buffers to recv */
>> + struct iovec *iov;
>
> Why is there the asymmetry between send and recv, where the send
> has the iovs_num and the recv doesn't?
When we are sending data, we have the normal page and the iov, so it is
normal_pages + 1. On reception side, we have to read first the header,
because that is where normal_pages is stored.
I can drop iovs_num on the send side and add a comment, but I think that
the new variable is more descriptive.
Or I can add iovs_num to the recv_side and just do a iovs_num =
normal_pages, but it seems a bit pointless, no?
Later, Juan.
- Re: [PATCH v4 04/23] migration: Remove masking for compression, (continued)
- [PATCH v4 02/23] migration: We only need last_stage in two places, Juan Quintela, 2022/01/11
- [PATCH v4 09/23] multifd: Make zlib use iov's, Juan Quintela, 2022/01/11
- [PATCH v4 05/23] migration: simplify do_compress_ram_page, Juan Quintela, 2022/01/11
- [PATCH v4 10/23] multifd: Make zstd use iov's, Juan Quintela, 2022/01/11
- [PATCH v4 07/23] multifd: Use proper maximum compression values, Juan Quintela, 2022/01/11
- [PATCH v4 08/23] multifd: Move iov from pages to params, Juan Quintela, 2022/01/11
- [PATCH v4 06/23] migration: Move ram_release_pages() call to save_zero_page_to_file(), Juan Quintela, 2022/01/11
- [PATCH v4 11/23] multifd: Remove send_write() method, Juan Quintela, 2022/01/11
- [PATCH v4 12/23] multifd: Use a single writev on the send side, Juan Quintela, 2022/01/11
- [PATCH v4 19/23] multifd: Add property to enable/disable zero_page, Juan Quintela, 2022/01/11
- [PATCH v4 22/23] migration: Use multifd before we check for the zero page, Juan Quintela, 2022/01/11