diff mbox

migrate: auto increase the strength to throttle vcpu

Message ID 1406599547-6804-1-git-send-email-arei.gonglei@huawei.com
State New
Headers show

Commit Message

Gonglei (Arei) July 29, 2014, 2:05 a.m. UTC
From: ChenLiang <chenliang88@huawei.com>

Previously, the strength to throttle vcpu is constant that is too
arbitrarily. This patch(suggested by Juan) increases the strength
according to the times of memory iterator.

Signed-off-by: ChenLiang <chenliang88@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 arch_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/arch_init.c b/arch_init.c
index 8ddaf35..02436e3 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -1372,8 +1372,10 @@  TargetInfo *qmp_query_target(Error **errp)
    VM to run inside qemu via async_run_on_cpu()*/
 static void mig_sleep_cpu(void *opq)
 {
+    uint64_t sleep_ms = bitmap_sync_count < 30 ? bitmap_sync_count : 30;
+
     qemu_mutex_unlock_iothread();
-    g_usleep(30*1000);
+    g_usleep(sleep_ms*1000);
     qemu_mutex_lock_iothread();
 }