qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3 07/10] migration: Fix the migrate auto converge p


From: arei.gonglei
Subject: [Qemu-devel] [PATCH v3 07/10] migration: Fix the migrate auto converge process
Date: Tue, 18 Mar 2014 20:24:21 +0800

From: ChenLiang <address@hidden>

It is inexact and complex to use the migration transfer speed to
determine whether migration is converging.

Signed-off-by: ChenLiang <address@hidden>
Signed-off-by: Gonglei <address@hidden>
---
 arch_init.c | 26 +++-----------------------
 1 file changed, 3 insertions(+), 23 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index 21d9cf6..d5479f2 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -107,7 +107,6 @@ int graphic_depth = 32;
 
 const uint32_t arch_type = QEMU_ARCH;
 static bool mig_throttle_on;
-static int dirty_rate_high_cnt;
 static void check_guest_throttling(void);
 
 static uint64_t bitmap_sync_counter;
@@ -492,19 +491,13 @@ static void migration_bitmap_sync(void)
     uint64_t num_dirty_pages_init = migration_dirty_pages;
     MigrationState *s = migrate_get_current();
     static int64_t start_time;
-    static int64_t bytes_xfer_prev;
     static int64_t num_dirty_pages_period;
     int64_t end_time;
-    int64_t bytes_xfer_now;
     static uint64_t xbzrle_cache_miss_prev = 0;
     static uint64_t iterations_prev = 0;
 
     bitmap_sync_counter++;
 
-    if (!bytes_xfer_prev) {
-        bytes_xfer_prev = ram_bytes_transferred();
-    }
-
     if (!start_time) {
         start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
     }
@@ -523,21 +516,9 @@ static void migration_bitmap_sync(void)
     /* more than 1 second = 1000 millisecons */
     if (end_time > start_time + 1000) {
         if (migrate_auto_converge()) {
-            /* 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
-               were in this routine. If that happens >N times (for now N==4)
-               we turn on the throttle down logic */
-            bytes_xfer_now = ram_bytes_transferred();
-            if (s->dirty_pages_rate &&
-               (num_dirty_pages_period * TARGET_PAGE_SIZE >
-                   (bytes_xfer_now - bytes_xfer_prev)/2) &&
-               (dirty_rate_high_cnt++ > 4)) {
-                    trace_migration_throttle();
-                    mig_throttle_on = true;
-                    dirty_rate_high_cnt = 0;
-             }
-             bytes_xfer_prev = bytes_xfer_now;
+            if (bitmap_sync_counter > 20) {
+                mig_throttle_on = true;
+            }
         } else {
              mig_throttle_on = false;
         }
@@ -758,7 +739,6 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
     bitmap_set(migration_bitmap, 0, ram_pages);
     migration_dirty_pages = ram_pages;
     mig_throttle_on = false;
-    dirty_rate_high_cnt = 0;
     bitmap_sync_counter = 0;
 
     if (migrate_use_xbzrle()) {
-- 
1.7.12.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]