qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 04/20] qemu-file: We only call qemu_file_transferred_* on


From: Juan Quintela
Subject: Re: [PATCH v2 04/20] qemu-file: We only call qemu_file_transferred_* on the sending side
Date: Tue, 13 Jun 2023 18:02:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Peter Xu <peterx@redhat.com> wrote:
> On Tue, May 30, 2023 at 08:39:25PM +0200, Juan Quintela wrote:
>> Remove the increase in qemu_file_fill_buffer() and add asserts to
>> qemu_file_transferred* functions.
>> 
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>
> The read side accounting does look a bit weird and never caught my notice..
>
> Maybe worth also touching the document of QEMUFile::total_transferred to
> clarify what it accounts?
>
> Reviewed-by: Peter Xu <peterx@redhat.com>
>
> Though when I'm looking at the counters (didn't follow every single recent
> patch on this..), I found that now reading transferred value is actually
> more expensive - qemu_file_transferred() needs flushing, even if for the
> fast version, qemu_file_transferred_fast() loops over all possible iovs,
> which can be as large as MAX_IOV_SIZE==64.
>
> To be explicit, I _think_ for each guest page we now need to flush...
>
>   ram_save_iterate
>     migration_rate_exceeded
>       migration_transferred_bytes
>         qemu_file_transferred
>
> I hope I'm wrong..

See patch 7:

diff --git a/migration/migration-stats.c b/migration/migration-stats.c
index 79eea8d865..1696185694 100644
--- a/migration/migration-stats.c
+++ b/migration/migration-stats.c
@@ -62,7 +62,7 @@ uint64_t migration_transferred_bytes(QEMUFile *f)
 {
     uint64_t multifd = stat64_get(&mig_stats.multifd_bytes);
     uint64_t rdma = stat64_get(&mig_stats.rdma_bytes);
-    uint64_t qemu_file = qemu_file_transferred(f);
+    uint64_t qemu_file = stat64_get(&mig_stats.qemu_file_transferred);
 
     trace_migration_transferred_bytes(qemu_file, multifd, rdma);
     return qemu_file + multifd + rdma;


> Does it mean that perhaps we simply need "sent and put into send buffer"
> more than "what really got transferred"?  So I start to wonder what's the
> origianl purpose of this change, and which one is better..

That is basically what patch 5 and 6 do O:-)

Problem is arriving to something that is bisectable (for correctness)
and is easy to review.

And yes, my choices can be different from the ones tat you do.

The other reason for the small patches is that:
a - sometimes I found a different test where things broke, and have to
    bisect
b - small patches are much easier to rebase (that I am doing a lot)

Later, Juan.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]