[PULL 05/18] migration: Stop CPU throttling conditionally

Peter Xu posted 18 patches 3 weeks, 3 days ago
There is a newer version of this series
[PULL 05/18] migration: Stop CPU throttling conditionally
Posted by Peter Xu 3 weeks, 3 days ago
From: Hyman Huang <yong.huang@smartx.com>

Since CPU throttling only occurs when auto-converge
is on, stop it conditionally.

Signed-off-by: Hyman Huang <yong.huang@smartx.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/f0c787080bb9ab0c37952f0ca5bfaa525d5ddd14.1729146786.git.yong.huang@smartx.com
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 migration/migration.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/migration/migration.c b/migration/migration.c
index 7609e0feed..e81c70b9d2 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3295,7 +3295,9 @@ static MigIterateState migration_iteration_run(MigrationState *s)
 static void migration_iteration_finish(MigrationState *s)
 {
     /* If we enabled cpu throttling for auto-converge, turn it off. */
-    cpu_throttle_stop();
+    if (migrate_auto_converge()) {
+        cpu_throttle_stop();
+    }
 
     bql_lock();
     switch (s->state) {
-- 
2.45.0