qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap
@ 2014-02-28  4:08 Gonglei (Arei)
  2014-02-28  9:37 ` Dr. David Alan Gilbert
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gonglei (Arei) @ 2014-02-28  4:08 UTC (permalink / raw)
  To: qemu-devel@nongnu.org
  Cc: Peter Maydell, Juan Quintela, pl@kamp.de, owasserm@redhat.com,
	aliguori@amazon.com, chenliang (T), pbonzini@redhat.com

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

Signed-off-by: ChenLiang <chenliang88@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-06 13:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-28  4:08 [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap Gonglei (Arei)
2014-02-28  9:37 ` Dr. David Alan Gilbert
2014-02-28 13:11 ` Eric Blake
2014-02-28 13:26   ` 陈梁
2014-03-05 16:18 ` Juan Quintela
2014-03-06 10:50   ` Gonglei
2014-03-06 13:19     ` Juan Quintela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).