All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] migration/multifd: correct multifd_send_thread to trace the flags
@ 2023-03-09 10:29 Wei Wang
  2023-03-16 14:33 ` Juan Quintela
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Wang @ 2023-03-09 10:29 UTC (permalink / raw
  To: quintela, dgilbert; +Cc: qemu-devel, Wei Wang

The p->flags could be updated via the send_prepare callback, e.g. OR-ed
with MULTIFD_FLAG_ZLIB via zlib_send_prepare. Assign p->flags to the
local "flags" before the send_prepare callback could only get partial of
p->flags. Fix it by moving the assignment of p->flags to the local flags
after the callback, so that the correct flags can be traced.

Fixes: ab7cbb0b9a3b ("multifd: Make no compression operations into its own structure")
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
---
 migration/multifd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/migration/multifd.c b/migration/multifd.c
index 5e85c3ea9b..cbc0dfe39b 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -677,7 +677,7 @@ static void *multifd_send_thread(void *opaque)
 
         if (p->pending_job) {
             uint64_t packet_num = p->packet_num;
-            uint32_t flags = p->flags;
+            uint32_t flags;
             p->normal_num = 0;
 
             if (use_zero_copy_send) {
@@ -699,6 +699,7 @@ static void *multifd_send_thread(void *opaque)
                 }
             }
             multifd_send_fill_packet(p);
+            flags = p->flags;
             p->flags = 0;
             p->num_packets++;
             p->total_normal_pages += p->normal_num;
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] migration/multifd: correct multifd_send_thread to trace the flags
  2023-03-09 10:29 [PATCH v1] migration/multifd: correct multifd_send_thread to trace the flags Wei Wang
@ 2023-03-16 14:33 ` Juan Quintela
  0 siblings, 0 replies; 2+ messages in thread
From: Juan Quintela @ 2023-03-16 14:33 UTC (permalink / raw
  To: Wei Wang; +Cc: dgilbert, qemu-devel

Wei Wang <wei.w.wang@intel.com> wrote:
> The p->flags could be updated via the send_prepare callback, e.g. OR-ed
> with MULTIFD_FLAG_ZLIB via zlib_send_prepare. Assign p->flags to the
> local "flags" before the send_prepare callback could only get partial of
> p->flags. Fix it by moving the assignment of p->flags to the local flags
> after the callback, so that the correct flags can be traced.
>
> Fixes: ab7cbb0b9a3b ("multifd: Make no compression operations into its own structure")
> Signed-off-by: Wei Wang <wei.w.wang@intel.com>


Reviewed-by: Juan Quintela <quintela@redhat.com>

Good catch.  Thanks.
queued.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-16 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-09 10:29 [PATCH v1] migration/multifd: correct multifd_send_thread to trace the flags Wei Wang
2023-03-16 14:33 ` Juan Quintela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.