[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/65] ram: Move iterations_prev into RAMState
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 13/65] ram: Move iterations_prev into RAMState |
Date: |
Fri, 21 Apr 2017 13:55:54 +0200 |
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
migration/ram.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 32b1cbb..5b6fef8 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -163,6 +163,8 @@ struct RAMState {
uint64_t num_dirty_pages_period;
/* xbzrle misses since the beginning of the period */
uint64_t xbzrle_cache_miss_prev;
+ /* number of iterations at the beginning of period */
+ uint64_t iterations_prev;
};
typedef struct RAMState RAMState;
@@ -625,16 +627,13 @@ static void migration_bitmap_sync_range(RAMState *rs,
ram_addr_t start,
start, length, &rs->num_dirty_pages_period);
}
-/* Fix me: there are too many global variables used in migration process. */
-static uint64_t iterations_prev;
-
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;
rs->xbzrle_cache_miss_prev = 0;
- iterations_prev = 0;
+ rs->iterations_prev = 0;
}
/**
@@ -712,13 +711,13 @@ static void migration_bitmap_sync(RAMState *rs)
}
if (migrate_use_xbzrle()) {
- if (iterations_prev != acct_info.iterations) {
+ if (rs->iterations_prev != acct_info.iterations) {
acct_info.xbzrle_cache_miss_rate =
(double)(acct_info.xbzrle_cache_miss -
rs->xbzrle_cache_miss_prev) /
- (acct_info.iterations - iterations_prev);
+ (acct_info.iterations - rs->iterations_prev);
}
- iterations_prev = acct_info.iterations;
+ rs->iterations_prev = acct_info.iterations;
rs->xbzrle_cache_miss_prev = acct_info.xbzrle_cache_miss;
}
s->dirty_pages_rate = rs->num_dirty_pages_period * 1000
--
2.9.3
- [Qemu-devel] [PULL 02/65] ram: Rename flush_page_queue() to migration_page_queue_free(), (continued)
- [Qemu-devel] [PULL 02/65] ram: Rename flush_page_queue() to migration_page_queue_free(), Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 03/65] ram: Rename block_name to rbname, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 01/65] ram: Update all functions comments, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 05/65] ram: Add dirty_rate_high_cnt to RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 04/65] ram: Create RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 06/65] ram: Move bitmap_sync_count into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 07/65] ram: Move start time into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 08/65] ram: Move bytes_xfer_prev into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 11/65] ram: Change num_dirty_pages_period type to uint64_t, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 10/65] ram: Move num_dirty_pages_period into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 13/65] ram: Move iterations_prev into RAMState,
Juan Quintela <=
- [Qemu-devel] [PULL 09/65] ram: Change byte_xfer_{prev, now} type to uint64_t, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 12/65] ram: Move xbzrle_cache_miss_prev into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 14/65] ram: Move dup_pages into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 16/65] ram: Remove unused pages_skipped variable, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 15/65] ram: Remove unused dup_mig_bytes_transferred(), Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 17/65] ram: Move norm_pages to RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 18/65] ram: Remove norm_mig_bytes_transferred, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 19/65] ram: Move iterations into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 20/65] ram: Move xbzrle_bytes into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 21/65] ram: Move xbzrle_pages into RAMState, Juan Quintela, 2017/04/21