diff options
author | Juan Quintela <quintela@redhat.com> | 2017-03-13 21:04:16 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2017-04-21 12:25:37 +0200 |
commit | b07016b674cb3e5393cb6365dd5628b57f7c03e6 (patch) | |
tree | f8cfe2a6d4b1ed798f691ea9aa5222ee004e217e /migration | |
parent | 544c36f188cb10f0c07d31c135f863972799e25c (diff) |
ram: Move xbzrle_cache_miss_rate 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.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/migration/ram.c b/migration/ram.c index b70db68b8f..09f9effe91 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -179,6 +179,8 @@ struct RAMState { uint64_t xbzrle_pages; /* xbzrle number of cache miss */ uint64_t xbzrle_cache_miss; + /* xbzrle miss rate */ + double xbzrle_cache_miss_rate; }; typedef struct RAMState RAMState; @@ -186,7 +188,6 @@ static RAMState ram_state; /* accounting for migration statistics */ typedef struct AccountingInfo { - double xbzrle_cache_miss_rate; uint64_t xbzrle_overflows; } AccountingInfo; @@ -224,7 +225,7 @@ uint64_t xbzrle_mig_pages_cache_miss(void) double xbzrle_mig_cache_miss_rate(void) { - return acct_info.xbzrle_cache_miss_rate; + return ram_state.xbzrle_cache_miss_rate; } uint64_t xbzrle_mig_pages_overflow(void) @@ -699,7 +700,7 @@ static void migration_bitmap_sync(RAMState *rs) if (migrate_use_xbzrle()) { if (rs->iterations_prev != rs->iterations) { - acct_info.xbzrle_cache_miss_rate = + rs->xbzrle_cache_miss_rate = (double)(rs->xbzrle_cache_miss - rs->xbzrle_cache_miss_prev) / (rs->iterations - rs->iterations_prev); @@ -2003,6 +2004,7 @@ static int ram_save_init_globals(RAMState *rs) rs->xbzrle_bytes = 0; rs->xbzrle_pages = 0; rs->xbzrle_cache_miss = 0; + rs->xbzrle_cache_miss_rate = 0; migration_bitmap_sync_init(rs); qemu_mutex_init(&migration_bitmap_mutex); |