[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 21/21] migration/multifd: Compute transferred bytes correctly
From: |
Juan Quintela |
Subject: |
Re: [PATCH 21/21] migration/multifd: Compute transferred bytes correctly |
Date: |
Thu, 18 May 2023 18:40:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Peter Xu <peterx@redhat.com> wrote:
> On Mon, May 08, 2023 at 03:09:09PM +0200, Juan Quintela wrote:
>> In the past, we had to put the in the main thread all the operations
>> related with sizes due to qemu_file not beeing thread safe. As now
>> all counters are atomic, we can update the counters just after the
>> do the write. As an aditional bonus, we are able to use the right
>> value for the compression methods. Right now we were assuming that
>> there were no compression at all.
>
> Maybe worth mention that initial packet is also accounted after this.
Ok.
>>
>> + stat64_add(&mig_stats.multifd_bytes, p->next_packet_size);
>> + stat64_add(&mig_stats.transferred, p->next_packet_size);
>
> Two nits:
>
> Maybe merge the two so half atomic operations?
On my tree, to send after this got in:
77fdd3475c migration: Remove transferred atomic counter
O:-)
> Also maybe also worth having a inline helper for adding both multifd_bytes
> and transferred?
I am removing it.
After next set of packates:
rate limit is calulated as:
begining_period = migration_transferred_bytes();
...
bytes_this_period = migration_transferred_bytes() - begining_period;
transferred is calculated as:
- multifd_bytes + qemu_file_bytes;
So things get really simple. As all counters are atomic, you do a
write and after the write to increse the write size to the qemu_file or
to the multifd_bytes. And that is it.
> With/without that, all look good:
>
> Reviewed-by: Peter Xu <peterx@redhat.com>
Thanks, Juan.
- [PATCH 13/21] migration: Use migration_transferred_bytes() to calculate rate_limit, (continued)
- [PATCH 13/21] migration: Use migration_transferred_bytes() to calculate rate_limit, Juan Quintela, 2023/05/08
- [PATCH 19/21] migration: Remove unused qemu_file_credit_transfer(), Juan Quintela, 2023/05/08
- [PATCH 16/21] migration/RDMA: It is accounting for zero/normal pages in two places, Juan Quintela, 2023/05/08
- [PATCH 17/21] migration/rdma: Remove QEMUFile parameter when not used, Juan Quintela, 2023/05/08
- [PATCH 14/21] migration: We don't need the field rate_limit_used anymore, Juan Quintela, 2023/05/08
- [PATCH 20/21] migration/rdma: Simplify the function that saves a page, Juan Quintela, 2023/05/08
- [PATCH 21/21] migration/multifd: Compute transferred bytes correctly, Juan Quintela, 2023/05/08