migration: disable auto-converge during bulk block migration
PATCH v3 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.
---V1->V2: add comment why we disable auto-converge during bulk block migration [Stefan] V2->V3: add missing patch for migration/block.h
migration/block.c | 5 +++++ migration/block.h | 7 +++++++ migration/ram.c | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-)
migration/block.c +5 -0
@@ -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
@@ -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 +5 -1
@@ -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
Signature · 1 line
1.9.1
Quoted 8 lines · * Peter Lieven ([email protected]) wrote:
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.
Signed-off-by Peter Lieven <[email protected]>
Quoted 77 lines
---
V1->V2: add comment why we disable auto-converge during bulk block migration [Stefan]V2->V3: add missing patch formigration/block.hmigration/block.c | 5 +++++ migration/block.h | 7 +++++++ migration/ram.c | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-)migration/block.c +5
-0@@ -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@@ -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 +5
-1@@ -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 Signature · 1 line
1.9.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Quoted 8 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.
Signed-off-by Peter Lieven <[email protected]>
Quoted 5 lines · * Peter Lieven ([email protected]) wrote:
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.
Queued for migration (which hopefully I'll send a pull later today)
Dave
Quoted 80 lines
Signed-off-by Peter Lieven <[email protected]>---
V1->V2: add comment why we disable auto-converge during bulk block migration [Stefan]V2->V3: add missing patch formigration/block.hmigration/block.c | 5 +++++ migration/block.h | 7 +++++++ migration/ram.c | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-)migration/block.c +5
-0@@ -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@@ -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 +5
-1@@ -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 Signature · 1 line
1.9.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK