qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 07/31] ram: Move xbzrle_cache_miss_prev into RAMStat


From: Juan Quintela
Subject: [Qemu-devel] [PATCH 07/31] ram: Move xbzrle_cache_miss_prev into RAMState
Date: Wed, 15 Mar 2017 14:49:57 +0100

Signed-off-by: Juan Quintela <address@hidden>
---
 migration/ram.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/migration/ram.c b/migration/ram.c
index b13d2d5..ae077c5 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -155,6 +155,8 @@ struct RAMState {
     int64_t bytes_xfer_prev;
     /* number of dirty pages since start_time */
     int64_t num_dirty_pages_period;
+    /* xbzrle misses since the beggining of the period */
+    uint64_t xbzrle_cache_miss_prev;
 };
 typedef struct RAMState RAMState;
 
@@ -601,7 +603,6 @@ static void migration_bitmap_sync_range(ram_addr_t start, 
ram_addr_t length)
 }
 
 /* Fix me: there are too many global variables used in migration process. */
-static uint64_t xbzrle_cache_miss_prev;
 static uint64_t iterations_prev;
 
 static void migration_bitmap_sync_init(RAMState *rs)
@@ -609,7 +610,7 @@ static void migration_bitmap_sync_init(RAMState *rs)
     rs->start_time = 0;
     rs->bytes_xfer_prev = 0;
     rs->num_dirty_pages_period = 0;
-    xbzrle_cache_miss_prev = 0;
+    rs->xbzrle_cache_miss_prev = 0;
     iterations_prev = 0;
 }
 
@@ -689,11 +690,11 @@ static void migration_bitmap_sync(RAMState *rs)
             if (iterations_prev != acct_info.iterations) {
                 acct_info.xbzrle_cache_miss_rate =
                    (double)(acct_info.xbzrle_cache_miss -
-                            xbzrle_cache_miss_prev) /
+                            rs->xbzrle_cache_miss_prev) /
                    (acct_info.iterations - iterations_prev);
             }
             iterations_prev = acct_info.iterations;
-            xbzrle_cache_miss_prev = acct_info.xbzrle_cache_miss;
+            rs->xbzrle_cache_miss_prev = acct_info.xbzrle_cache_miss;
         }
         s->dirty_pages_rate = rs->num_dirty_pages_period * 1000
             / (end_time - rs->start_time);
-- 
2.9.3




reply via email to

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