diff options
Diffstat (limited to 'migration')
-rw-r--r-- | migration/ram.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/migration/ram.c b/migration/ram.c index 719425b9b8..de1e0a3b18 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -576,18 +576,18 @@ static inline bool migration_bitmap_clear_dirty(ram_addr_t addr) return ret; } +static int64_t num_dirty_pages_period; static void migration_bitmap_sync_range(ram_addr_t start, ram_addr_t length) { unsigned long *bitmap; bitmap = atomic_rcu_read(&migration_bitmap_rcu)->bmap; - migration_dirty_pages += - cpu_physical_memory_sync_dirty_bitmap(bitmap, start, length); + migration_dirty_pages += cpu_physical_memory_sync_dirty_bitmap(bitmap, + start, length, &num_dirty_pages_period); } /* Fix me: there are too many global variables used in migration process. */ static int64_t start_time; static int64_t bytes_xfer_prev; -static int64_t num_dirty_pages_period; static uint64_t xbzrle_cache_miss_prev; static uint64_t iterations_prev; @@ -620,7 +620,6 @@ uint64_t ram_pagesize_summary(void) static void migration_bitmap_sync(void) { RAMBlock *block; - uint64_t num_dirty_pages_init = migration_dirty_pages; MigrationState *s = migrate_get_current(); int64_t end_time; int64_t bytes_xfer_now; @@ -646,9 +645,8 @@ static void migration_bitmap_sync(void) rcu_read_unlock(); qemu_mutex_unlock(&migration_bitmap_mutex); - trace_migration_bitmap_sync_end(migration_dirty_pages - - num_dirty_pages_init); - num_dirty_pages_period += migration_dirty_pages - num_dirty_pages_init; + trace_migration_bitmap_sync_end(num_dirty_pages_period); + end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); /* more than 1 second = 1000 millisecons */ |