Skip to contentSkip to conversation

migration: disable auto-converge during bulk block migration

PATCH Superseded Peter Lieven 3 participants 5 messages Sep 21, 2017 – Sep 28, 2017

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: disable auto-converge during bulk block migration

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.

---
 migration/block.c | 5 +++++
 migration/block.h | 7 +++++++
 migration/ram.c   | 3 ++-
 3 files changed, 14 insertions(+), 1 deletion(-)
migration/block.c +5 -0
index 9171f60..606ad4d 100644
@@ -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;
migration/block.h +7 -0
index 22ebe94..3178609 100644
@@ -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;
migration/ram.c +2 -1
index e18b3e2..720470e 100644
@@ -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 */
@@ -623,7 +624,7 @@ static void migration_bitmap_sync(RAMState *rs)
             / (end_time - rs->time_last_bitmap_sync);
         bytes_xfer_now = ram_counters.transferred;
 
-        if (migrate_auto_converge()) {
+        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
Signature · 1 line
1.9.1
#1 lore raw
Quoted 5 lines · Peter Lieven

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.

Please include the rationale in a comment here:

migration/ram.c static void migration_bitmap_sync(RAMState *rs) · line 627

Quoted 2 lines
migration/ram.c +1 -1
-        if (migrate_auto_converge()) {
+        if (migrate_auto_converge() && !blk_mig_bulk_active()) {

That way it's clear why auto-converge isn't enabled when block migration is active.

#2 lore raw
In reply to Peter Lieven

Quoting Peter Lieven (2017-09-21 07:32:32)

Quoted 8 lines

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.

FYI: this patch has been tagged for stable 2.10.1, but is not yet upstream. Patch freeze for 2.10.1 is September 27th.

Quoted 72 lines
---
 migration/block.c | 5 +++++
 migration/block.h | 7 +++++++
 migration/ram.c   | 3 ++-
 3 files changed, 14 insertions(+), 1 deletion(-)
migration/block.c +5 -0
index 9171f60..606ad4d 100644
@@ -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;
migration/block.h +7 -0
index 22ebe94..3178609 100644
@@ -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;
migration/ram.c +2 -1
index e18b3e2..720470e 100644
@@ -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 */
@@ -623,7 +624,7 @@ static void migration_bitmap_sync(RAMState *rs)
             / (end_time - rs->time_last_bitmap_sync);
         bytes_xfer_now = ram_counters.transferred;
 
-        if (migrate_auto_converge()) {
+        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
Signature · 1 line
1.9.1
#3 lore raw

Am 25.09.2017 um 22:53 schrieb Michael Roth:

Quoted 11 lines

Quoting Peter Lieven (2017-09-21 07:32:32)

Quoted 8 lines

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.

FYI: this patch has been tagged for stable 2.10.1, but is not yet upstream. Patch freeze for 2.10.1 is September 27th.

I just send a V2 of the patch adding a comment to the code why auto-converge is disabled during bulk block migration. Maybe someone can review it and pick it up.

Peter

#4 lore raw
In reply to Michael Roth

Am 25.09.2017 um 22:53 schrieb Michael Roth:

Quoted 11 lines

Quoting Peter Lieven (2017-09-21 07:32:32)

Quoted 8 lines

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.

FYI: this patch has been tagged for stable 2.10.1, but is not yet upstream. Patch freeze for 2.10.1 is September 27th.

Hi Michael,

the patch went upstream yesterday.

Peter