Message ID | b856c56e59904aa947f7a13ebae5e8f527c15fc9.1670087276.git.huangy81@chinatelecom.cn |
---|---|
State | New |
Headers | show |
Series | migration: introduce dirtylimit capability | expand |
On Sun, Dec 04, 2022 at 01:09:10AM +0800, huangy81@chinatelecom.cn wrote: > From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn> > > Check if block migration is running before throttling > guest down in auto-converge way. > > Note that this modification is kind of like code clean, > because block migration does not depend on auto-converge > capability, so the order of checks can be adjusted. > > Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn> Acked-by: Peter Xu <peterx@redhat.com>
diff --git a/migration/ram.c b/migration/ram.c index 1338e47..5e66652 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1151,7 +1151,11 @@ static void migration_trigger_throttle(RAMState *rs) /* 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()) { + if (blk_mig_bulk_active()) { + return; + } + + if (migrate_auto_converge()) { /* The following detection logic can be refined later. For now: Check to see if the ratio between dirtied bytes and the approx. amount of bytes that just got transferred since the last time