qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Cc: quintela@redhat.com, peterx@redhat.com, farosas@suse.de,
	leobras@redhat.com, qemu-devel@nongnu.org
Subject: [PATCH v2 4/4] multifd: reset next_packet_len after sending pages
Date: Wed, 11 Oct 2023 11:43:58 -0700	[thread overview]
Message-ID: <20231011184358.97349-5-elena.ufimtseva@oracle.com> (raw)
In-Reply-To: <20231011184358.97349-1-elena.ufimtseva@oracle.com>

Sometimes multifd sends just sync packet with no pages
(normal_num is 0). In this case the old value is being
preserved and being accounted for while only packet_len
is being transferred.
Reset it to 0 after sending and accounting for.

Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
---
 migration/multifd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/migration/multifd.c b/migration/multifd.c
index e6e0013c16..c45f5015f8 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -730,6 +730,7 @@ static void *multifd_send_thread(void *opaque)
                        p->next_packet_size + p->packet_len);
             stat64_add(&mig_stats.transferred,
                        p->next_packet_size + p->packet_len);
+            p->next_packet_size = 0;
             qemu_mutex_lock(&p->mutex);
             p->pending_job--;
             qemu_mutex_unlock(&p->mutex);
-- 
2.34.1



  parent reply	other threads:[~2023-10-11 18:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11 18:43 [PATCH v2 0/4] multifd: various fixes Elena Ufimtseva
2023-10-11 18:43 ` [PATCH v2 1/4] migration: check for rate_limit_max for RATE_LIMIT_DISABLED Elena Ufimtseva
2023-10-16  7:23   ` Juan Quintela
2023-10-11 18:43 ` [PATCH v2 2/4] multifd: document packet_len, next_packet_size Elena Ufimtseva
2023-10-11 19:04   ` Fabiano Rosas
2023-10-11 18:43 ` [PATCH v2 3/4] multifd: fix counters in multifd_send_thread Elena Ufimtseva
2023-10-16  7:25   ` Juan Quintela
2023-10-11 18:43 ` Elena Ufimtseva [this message]
2023-10-16  7:26   ` [PATCH v2 4/4] multifd: reset next_packet_len after sending pages Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231011184358.97349-5-elena.ufimtseva@oracle.com \
    --to=elena.ufimtseva@oracle.com \
    --cc=farosas@suse.de \
    --cc=leobras@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).