aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2017-03-13 21:02:08 +0100
committerJuan Quintela <quintela@redhat.com>2017-04-21 12:25:37 +0200
commit544c36f188cb10f0c07d31c135f863972799e25c (patch)
treeae29ed2f8f84c4bdd7c3969915a8902653fb69ca /migration
parentf36ada95dedefaf2a47f19ae3214913506716b90 (diff)
ram: Move xbzrle_cache_miss into RAMState
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/ram.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/migration/ram.c b/migration/ram.c
index cf6681c467..b70db68b8f 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -177,6 +177,8 @@ struct RAMState {
uint64_t xbzrle_bytes;
/* xbzrle transmmited pages */
uint64_t xbzrle_pages;
+ /* xbzrle number of cache miss */
+ uint64_t xbzrle_cache_miss;
};
typedef struct RAMState RAMState;
@@ -184,7 +186,6 @@ static RAMState ram_state;
/* accounting for migration statistics */
typedef struct AccountingInfo {
- uint64_t xbzrle_cache_miss;
double xbzrle_cache_miss_rate;
uint64_t xbzrle_overflows;
} AccountingInfo;
@@ -218,7 +219,7 @@ uint64_t xbzrle_mig_pages_transferred(void)
uint64_t xbzrle_mig_pages_cache_miss(void)
{
- return acct_info.xbzrle_cache_miss;
+ return ram_state.xbzrle_cache_miss;
}
double xbzrle_mig_cache_miss_rate(void)
@@ -498,7 +499,7 @@ static int save_xbzrle_page(RAMState *rs, QEMUFile *f, uint8_t **current_data,
uint8_t *prev_cached_page;
if (!cache_is_cached(XBZRLE.cache, current_addr, rs->bitmap_sync_count)) {
- acct_info.xbzrle_cache_miss++;
+ rs->xbzrle_cache_miss++;
if (!last_stage) {
if (cache_insert(XBZRLE.cache, current_addr, *current_data,
rs->bitmap_sync_count) == -1) {
@@ -699,12 +700,12 @@ static void migration_bitmap_sync(RAMState *rs)
if (migrate_use_xbzrle()) {
if (rs->iterations_prev != rs->iterations) {
acct_info.xbzrle_cache_miss_rate =
- (double)(acct_info.xbzrle_cache_miss -
+ (double)(rs->xbzrle_cache_miss -
rs->xbzrle_cache_miss_prev) /
(rs->iterations - rs->iterations_prev);
}
rs->iterations_prev = rs->iterations;
- rs->xbzrle_cache_miss_prev = acct_info.xbzrle_cache_miss;
+ rs->xbzrle_cache_miss_prev = rs->xbzrle_cache_miss;
}
s->dirty_pages_rate = rs->num_dirty_pages_period * 1000
/ (end_time - rs->time_last_bitmap_sync);
@@ -2001,6 +2002,7 @@ static int ram_save_init_globals(RAMState *rs)
rs->iterations = 0;
rs->xbzrle_bytes = 0;
rs->xbzrle_pages = 0;
+ rs->xbzrle_cache_miss = 0;
migration_bitmap_sync_init(rs);
qemu_mutex_init(&migration_bitmap_mutex);