qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richardw.yang@linux.intel.com>
To: quintela@redhat.com, dgilbert@redhat.com
Cc: qemu-devel@nongnu.org, Wei Yang <richardw.yang@linux.intel.com>
Subject: [PATCH v2 4/6] migration/multifd: used must not be 0 for a pending job
Date: Sat, 26 Oct 2019 08:45:18 +0800	[thread overview]
Message-ID: <20191026004520.5515-5-richardw.yang@linux.intel.com> (raw)
In-Reply-To: <20191026004520.5515-1-richardw.yang@linux.intel.com>

After thread synchronization request is handled in another case, this
means when we only get pending_job when there is used pages.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 migration/ram.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/migration/ram.c b/migration/ram.c
index 62072b7a35..12c270e86d 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1132,12 +1132,11 @@ static void *multifd_send_thread(void *opaque)
                 break;
             }
 
-            if (used) {
-                ret = qio_channel_writev_all(p->c, p->pages->iov,
-                                             used, &local_err);
-                if (ret != 0) {
-                    break;
-                }
+            assert(used);
+            ret = qio_channel_writev_all(p->c, p->pages->iov,
+                                         used, &local_err);
+            if (ret != 0) {
+                break;
             }
 
             qemu_mutex_lock(&p->mutex);
-- 
2.17.1



  parent reply	other threads:[~2019-10-26  1:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-26  0:45 [PATCH v2 0/6] migration/multifd: a new mechanism for send thread sync Wei Yang
2019-10-26  0:45 ` [PATCH v2 1/6] migration/multifd: move Params update and pages cleanup into multifd_send_fill_packet() Wei Yang
2019-11-19 10:57   ` Juan Quintela
2019-11-29  8:30     ` Wei Yang
2019-10-26  0:45 ` [PATCH v2 2/6] migration/multifd: notify channels_ready when send thread starts Wei Yang
2019-10-26  0:45 ` [PATCH v2 3/6] migration/multifd: use sync field to synchronize send threads Wei Yang
2019-10-26  0:45 ` Wei Yang [this message]
2019-10-26  0:45 ` [PATCH v2 5/6] migration/multifd: use boolean for pending_job is enough Wei Yang
2019-10-26  0:45 ` [PATCH v2 6/6] migration/multifd: there is no spurious wakeup now Wei Yang
2019-12-16  2:36 ` [PATCH v2 0/6] migration/multifd: a new mechanism for send thread sync Wei Yang

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=20191026004520.5515-5-richardw.yang@linux.intel.com \
    --to=richardw.yang@linux.intel.com \
    --cc=dgilbert@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).