diff mbox series

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

Message ID 20241030155734.2141398-6-peterx@redhat.com
State New
Headers show
Series [PULL,01/18] migration: Cleanup migrate_fd_cleanup() on accessing to_dst_file | expand

Commit Message

Peter Xu Oct. 30, 2024, 3:57 p.m. UTC
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 mbox series

Patch

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) {