aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2017-03-13 19:49:19 +0100
committerJuan Quintela <quintela@redhat.com>2017-04-21 12:25:36 +0200
commitb5833fde40b1c32eb80887cf55e971973856a412 (patch)
treeaa550f0098b57c4c29e8c886447e983f4fe9b799 /migration
parent68908ed665f4d97afb271c5d5b564d951951538c (diff)
ram: Move xbzrle_cache_miss_prev into RAMState
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'migration')
-rw-r--r--migration/ram.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/migration/ram.c b/migration/ram.c
index 9a823558db..32b1cbb0cd 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -161,6 +161,8 @@ struct RAMState {
uint64_t bytes_xfer_prev;
/* number of dirty pages since start_time */
uint64_t num_dirty_pages_period;
+ /* xbzrle misses since the beginning of the period */
+ uint64_t xbzrle_cache_miss_prev;
};
typedef struct RAMState RAMState;
@@ -624,7 +626,6 @@ static void migration_bitmap_sync_range(RAMState *rs, ram_addr_t start,
}
/* 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)
@@ -632,7 +633,7 @@ static void migration_bitmap_sync_init(RAMState *rs)
rs->time_last_bitmap_sync = 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;
}
@@ -714,11 +715,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->time_last_bitmap_sync);