qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com
Subject: [Qemu-devel] [PATCH v15 12/12] migration: Stop sending whole pages through main channel
Date: Thu, 21 Jun 2018 01:28:51 +0200	[thread overview]
Message-ID: <20180620232851.7152-13-quintela@redhat.com> (raw)
In-Reply-To: <20180620232851.7152-1-quintela@redhat.com>

We have to flush() the QEMUFile because now we sent really few data
through that channel.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/ram.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/migration/ram.c b/migration/ram.c
index 57d3ad1c45..6d0782623c 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1824,15 +1824,7 @@ static int ram_save_page(RAMState *rs, PageSearchStatus *pss, bool last_stage)
 static int ram_save_multifd_page(RAMState *rs, RAMBlock *block,
                                  ram_addr_t offset)
 {
-    uint8_t *p;
-
-    p = block->host + offset;
-
-    ram_counters.transferred += save_page_header(rs, rs->f, block,
-                                                 offset | RAM_SAVE_FLAG_PAGE);
     multifd_queue_page(block, offset);
-    qemu_put_buffer(rs->f, p, TARGET_PAGE_SIZE);
-    ram_counters.transferred += TARGET_PAGE_SIZE;
     ram_counters.normal++;
 
     return 1;
@@ -3073,6 +3065,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
 
     multifd_send_sync_main();
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
+    qemu_fflush(f);
 
     return 0;
 }
@@ -3155,6 +3148,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
     multifd_send_sync_main();
 out:
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
+    qemu_fflush(f);
     ram_counters.transferred += 8;
 
     ret = qemu_file_get_error(f);
@@ -3208,6 +3202,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
 
     multifd_send_sync_main();
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
+    qemu_fflush(f);
 
     return 0;
 }
-- 
2.17.1

  parent reply	other threads:[~2018-06-20 23:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 23:28 [Qemu-devel] [PATCH v15 00/12] Multifd Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 01/12] migration: Create multipage support Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 02/12] migration: Create multifd packet Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 03/12] migration: Add multifd traces for start/end thread Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 04/12] migration: Calculate transferred ram correctly Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 05/12] migration: Multifd channels always wait on the sem Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 06/12] migration: Add block where to send/receive packets Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 07/12] migration: Synchronize multifd threads with main thread Juan Quintela
2018-06-21  9:57   ` Dr. David Alan Gilbert
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 08/12] migration: Create ram_save_multifd_page Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 09/12] migration: Start sending messages Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 10/12] migration: Wait for blocking IO Juan Quintela
2018-06-20 23:28 ` [Qemu-devel] [PATCH v15 11/12] migration: Remove not needed semaphore and quit Juan Quintela
2018-06-20 23:28 ` Juan Quintela [this message]
2018-06-21  1:08 ` [Qemu-devel] [PATCH v15 00/12] Multifd no-reply

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=20180620232851.7152-13-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).