aboutsummaryrefslogtreecommitdiff
path: root/migration/ram.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-04-11 18:19:05 +0200
committerJuan Quintela <quintela@redhat.com>2023-04-27 16:39:49 +0200
commit72f8e58707395d24c177ffa9f88a25329638fc98 (patch)
tree831490c8c51fc2039952f5ed3740addd543cbcfe /migration/ram.c
parent7757b55eedd5d571d0b0c5f570b01dc3ca910a62 (diff)
migration: Make dirty_pages_rate atomic
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Xu <peterx@redhat.com> --- Don't use __nocheck() variants Use stat64_get()
Diffstat (limited to 'migration/ram.c')
-rw-r--r--migration/ram.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/migration/ram.c b/migration/ram.c
index e9dcda8b9d..5846f6e27f 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1130,8 +1130,9 @@ static void migration_update_rates(RAMState *rs, int64_t end_time)
double compressed_size;
/* calculate period counters */
- ram_counters.dirty_pages_rate = rs->num_dirty_pages_period * 1000
- / (end_time - rs->time_last_bitmap_sync);
+ stat64_set(&ram_counters.dirty_pages_rate,
+ rs->num_dirty_pages_period * 1000 /
+ (end_time - rs->time_last_bitmap_sync));
if (!page_count) {
return;