[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 08/12] migration: Make postcopy_requests atomic
From: |
Juan Quintela |
Subject: |
[PATCH v3 08/12] migration: Make postcopy_requests atomic |
Date: |
Wed, 19 Apr 2023 18:24:11 +0200 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/ram.h | 2 +-
migration/migration.c | 3 ++-
migration/ram.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/migration/ram.h b/migration/ram.h
index 8c0d07c43a..afa68521d7 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -49,7 +49,7 @@ typedef struct {
Stat64 multifd_bytes;
Stat64 normal;
Stat64 postcopy_bytes;
- int64_t postcopy_requests;
+ Stat64 postcopy_requests;
Stat64 precopy_bytes;
int64_t remaining;
Stat64 transferred;
diff --git a/migration/migration.c b/migration/migration.c
index 97c227aa85..09b37a6603 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1152,7 +1152,8 @@ static void populate_ram_info(MigrationInfo *info,
MigrationState *s)
stat64_get(&ram_counters.dirty_sync_count);
info->ram->dirty_sync_missed_zero_copy =
stat64_get(&ram_counters.dirty_sync_missed_zero_copy);
- info->ram->postcopy_requests = ram_counters.postcopy_requests;
+ info->ram->postcopy_requests =
+ stat64_get(&ram_counters.postcopy_requests);
info->ram->page_size = page_size;
info->ram->multifd_bytes = stat64_get(&ram_counters.multifd_bytes);
info->ram->pages_per_second = s->pages_per_second;
diff --git a/migration/ram.c b/migration/ram.c
index b391546020..b4aa07118a 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2169,7 +2169,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t
start, ram_addr_t len)
RAMBlock *ramblock;
RAMState *rs = ram_state;
- ram_counters.postcopy_requests++;
+ stat64_add(&ram_counters.postcopy_requests, 1);
RCU_READ_LOCK_GUARD();
if (!rbname) {
--
2.39.2
- [PATCH v3 00/12] Migration: Make more ram_counters atomic, Juan Quintela, 2023/04/19
- [PATCH v3 01/12] migration: Merge ram_counters and ram_atomic_counters, Juan Quintela, 2023/04/19
- [PATCH v3 04/12] migration: Make dirty_sync_missed_zero_copy atomic, Juan Quintela, 2023/04/19
- [PATCH v3 03/12] migration: Make multifd_bytes atomic, Juan Quintela, 2023/04/19
- [PATCH v3 06/12] migration: Make downtime_bytes atomic, Juan Quintela, 2023/04/19
- [PATCH v3 02/12] migration: Update atomic stats out of the mutex, Juan Quintela, 2023/04/19
- [PATCH v3 08/12] migration: Make postcopy_requests atomic,
Juan Quintela <=
- [PATCH v3 05/12] migration: Make precopy_bytes atomic, Juan Quintela, 2023/04/19
- [PATCH v3 10/12] migration: Make dirty_bytes_last_sync atomic, Juan Quintela, 2023/04/19
- [PATCH v3 09/12] migration: Make dirty_pages_rate atomic, Juan Quintela, 2023/04/19
- [PATCH v3 07/12] migration: Make dirty_sync_count atomic, Juan Quintela, 2023/04/19
- [PATCH v3 11/12] migration: Rename duplicate to zero_pages, Juan Quintela, 2023/04/19
- [PATCH v3 12/12] migration: Rename normal to full_pages, Juan Quintela, 2023/04/19
- Re: [PATCH v3 00/12] Migration: Make more ram_counters atomic, Peter Xu, 2023/04/19