qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: pl@kamp.de, quintela@redhat.com
Subject: [Qemu-devel] [PULL 1/7] migration: disable auto-converge during bulk block migration
Date: Wed, 27 Sep 2017 14:57:36 +0100	[thread overview]
Message-ID: <20170927135742.19724-2-dgilbert@redhat.com> (raw)
In-Reply-To: <20170927135742.19724-1-dgilbert@redhat.com>

From: Peter Lieven <pl@kamp.de>

auto-converge and block migration currently do not play well together.
During block migration the auto-converge logic detects that ram
migration makes no progress and thus throttles down the vm until
it nearly stalls completely. Avoid this by disabling the throttling
logic during the bulk phase of the block migration.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
Message-Id: <1506421996-12513-1-git-send-email-pl@kamp.de>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/block.c | 5 +++++
 migration/block.h | 7 +++++++
 migration/ram.c   | 6 +++++-
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/migration/block.c b/migration/block.c
index 9171f60028..606ad4db92 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -161,6 +161,11 @@ int blk_mig_active(void)
     return !QSIMPLEQ_EMPTY(&block_mig_state.bmds_list);
 }
 
+int blk_mig_bulk_active(void)
+{
+    return blk_mig_active() && !block_mig_state.bulk_completed;
+}
+
 uint64_t blk_mig_bytes_transferred(void)
 {
     BlkMigDevState *bmds;
diff --git a/migration/block.h b/migration/block.h
index 22ebe94259..3178609dbd 100644
--- a/migration/block.h
+++ b/migration/block.h
@@ -16,6 +16,7 @@
 
 #ifdef CONFIG_LIVE_BLOCK_MIGRATION
 int blk_mig_active(void);
+int blk_mig_bulk_active(void);
 uint64_t blk_mig_bytes_transferred(void);
 uint64_t blk_mig_bytes_remaining(void);
 uint64_t blk_mig_bytes_total(void);
@@ -25,6 +26,12 @@ static inline int blk_mig_active(void)
 {
     return false;
 }
+
+static inline int blk_mig_bulk_active(void)
+{
+    return false;
+}
+
 static inline uint64_t blk_mig_bytes_transferred(void)
 {
     return 0;
diff --git a/migration/ram.c b/migration/ram.c
index 88ca69e7b2..b83f8977c5 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -46,6 +46,7 @@
 #include "exec/ram_addr.h"
 #include "qemu/rcu_queue.h"
 #include "migration/colo.h"
+#include "migration/block.h"
 
 /***********************************************************/
 /* ram save/restore */
@@ -825,7 +826,10 @@ static void migration_bitmap_sync(RAMState *rs)
             / (end_time - rs->time_last_bitmap_sync);
         bytes_xfer_now = ram_counters.transferred;
 
-        if (migrate_auto_converge()) {
+        /* During block migration the auto-converge logic incorrectly detects
+         * that ram migration makes no progress. Avoid this by disabling the
+         * throttling logic during the bulk phase of block migration. */
+        if (migrate_auto_converge() && !blk_mig_bulk_active()) {
             /* The following detection logic can be refined later. For now:
                Check to see if the dirtied bytes is 50% more than the approx.
                amount of bytes that just got transferred since the last time we
-- 
2.13.5

  reply	other threads:[~2017-09-27 13:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 13:57 [Qemu-devel] [PULL 0/7] migration queue Dr. David Alan Gilbert (git)
2017-09-27 13:57 ` Dr. David Alan Gilbert (git) [this message]
2017-09-27 13:57 ` [Qemu-devel] [PULL 2/7] migration: pre_save return int Dr. David Alan Gilbert (git)
2017-09-27 13:57 ` [Qemu-devel] [PULL 3/7] migration: check pre_save return in vmstate_save_state Dr. David Alan Gilbert (git)
2017-09-27 13:57 ` [Qemu-devel] [PULL 4/7] migration: Check field save returns Dr. David Alan Gilbert (git)
2017-09-27 13:57 ` [Qemu-devel] [PULL 5/7] migration: wire vmstate_save_state errors up to vmstate_subsection_save Dr. David Alan Gilbert (git)
2017-09-27 13:57 ` [Qemu-devel] [PULL 6/7] migration: Route errors up through vmstate_save Dr. David Alan Gilbert (git)
2017-09-27 13:57 ` [Qemu-devel] [PULL 7/7] migration: Route more error paths Dr. David Alan Gilbert (git)
2017-09-27 23:29 ` [Qemu-devel] [PULL 0/7] migration queue Peter Maydell

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=20170927135742.19724-2-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=pl@kamp.de \
    --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).