qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty b


From: Gonglei (Arei)
Subject: [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap
Date: Fri, 28 Feb 2014 04:08:37 +0000

Add counters to log the times of updating the dirty bitmap.

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

diff --git a/arch_init.c b/arch_init.c
index bc8d0eb..6823c5a 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -110,6 +110,23 @@ static bool mig_throttle_on;
 static int dirty_rate_high_cnt;
 static void check_guest_throttling(void);
 
+static uint64_t bitmap_sync_cnt;
+/* the functions *_bitmap_sync_cnt only run in migrate thread */
+static inline void reset_bitmap_sync_cnt(void)
+{
+    bitmap_sync_cnt = 0;
+}
+
+static inline void increase_bitmap_sync_cnt(void)
+{
+    bitmap_sync_cnt++;
+}
+
+static inline uint64_t get_bitmap_sync_cnt(void)
+{
+    return bitmap_sync_cnt;
+}
+
 /***********************************************************/
 /* ram save/restore */
 
@@ -450,6 +467,8 @@ static void migration_bitmap_sync(void)
     int64_t end_time;
     int64_t bytes_xfer_now;
 
+    increase_bitmap_sync_cnt();
+
     if (!bytes_xfer_prev) {
         bytes_xfer_prev = ram_bytes_transferred();
     }
@@ -692,6 +711,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
     migration_dirty_pages = ram_pages;
     mig_throttle_on = false;
     dirty_rate_high_cnt = 0;
+    reset_bitmap_sync_cnt();
 
     if (migrate_use_xbzrle()) {
         XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() /
-- 
1.7.12.4


Best regards,
-Gonglei





reply via email to

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