[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/10] migration: Add counters of updating the dirty
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH 02/10] migration: Add counters of updating the dirty bitmap |
Date: |
Tue, 11 Mar 2014 20:53:27 +0800 |
From: ChenLiang <address@hidden>
Add counters to log the times of updating the dirty bitmap.
Signed-off-by: ChenLiang <address@hidden>
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
arch_init.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch_init.c b/arch_init.c
index 2ac68c2..37e4aa5 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 */
@@ -487,6 +504,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();
}
@@ -734,6 +753,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()) {
qemu_mutex_lock_iothread();
--
1.7.12.4
- Re: [Qemu-devel] [PATCH 09/10] migration: expose the bitmap_sync_cnt to the end user, (continued)