修訂 | ae6806688016711bb9ec7541266d76ab511c5e3b (tree) |
---|---|
時間 | 2022-01-28 23:38:23 |
作者 | David Edmondson <david.edmondson@orac...> |
Commiter | Juan Quintela |
migration: Tally pre-copy, downtime and post-copy bytes independently
Provide information on the number of bytes copied in the pre-copy,
downtime and post-copy phases of migration.
Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
@@ -1014,6 +1014,9 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) | ||
1014 | 1014 | info->ram->page_size = page_size; |
1015 | 1015 | info->ram->multifd_bytes = ram_counters.multifd_bytes; |
1016 | 1016 | info->ram->pages_per_second = s->pages_per_second; |
1017 | + info->ram->precopy_bytes = ram_counters.precopy_bytes; | |
1018 | + info->ram->downtime_bytes = ram_counters.downtime_bytes; | |
1019 | + info->ram->postcopy_bytes = ram_counters.postcopy_bytes; | |
1017 | 1020 | |
1018 | 1021 | if (migrate_use_xbzrle()) { |
1019 | 1022 | info->has_xbzrle_cache = true; |
@@ -389,6 +389,13 @@ MigrationStats ram_counters; | ||
389 | 389 | |
390 | 390 | static void ram_transferred_add(uint64_t bytes) |
391 | 391 | { |
392 | + if (runstate_is_running()) { | |
393 | + ram_counters.precopy_bytes += bytes; | |
394 | + } else if (migration_in_postcopy()) { | |
395 | + ram_counters.postcopy_bytes += bytes; | |
396 | + } else { | |
397 | + ram_counters.downtime_bytes += bytes; | |
398 | + } | |
392 | 399 | ram_counters.transferred += bytes; |
393 | 400 | } |
394 | 401 |
@@ -293,6 +293,18 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) | ||
293 | 293 | monitor_printf(mon, "postcopy request count: %" PRIu64 "\n", |
294 | 294 | info->ram->postcopy_requests); |
295 | 295 | } |
296 | + if (info->ram->precopy_bytes) { | |
297 | + monitor_printf(mon, "precopy ram: %" PRIu64 " kbytes\n", | |
298 | + info->ram->precopy_bytes >> 10); | |
299 | + } | |
300 | + if (info->ram->downtime_bytes) { | |
301 | + monitor_printf(mon, "downtime ram: %" PRIu64 " kbytes\n", | |
302 | + info->ram->downtime_bytes >> 10); | |
303 | + } | |
304 | + if (info->ram->postcopy_bytes) { | |
305 | + monitor_printf(mon, "postcopy ram: %" PRIu64 " kbytes\n", | |
306 | + info->ram->postcopy_bytes >> 10); | |
307 | + } | |
296 | 308 | } |
297 | 309 | |
298 | 310 | if (info->has_disk) { |
@@ -46,6 +46,15 @@ | ||
46 | 46 | # @pages-per-second: the number of memory pages transferred per second |
47 | 47 | # (Since 4.0) |
48 | 48 | # |
49 | +# @precopy-bytes: The number of bytes sent in the pre-copy phase | |
50 | +# (since 7.0). | |
51 | +# | |
52 | +# @downtime-bytes: The number of bytes sent while the guest is paused | |
53 | +# (since 7.0). | |
54 | +# | |
55 | +# @postcopy-bytes: The number of bytes sent during the post-copy phase | |
56 | +# (since 7.0). | |
57 | +# | |
49 | 58 | # Since: 0.14 |
50 | 59 | ## |
51 | 60 | { 'struct': 'MigrationStats', |
@@ -54,7 +63,9 @@ | ||
54 | 63 | 'normal-bytes': 'int', 'dirty-pages-rate' : 'int', |
55 | 64 | 'mbps' : 'number', 'dirty-sync-count' : 'int', |
56 | 65 | 'postcopy-requests' : 'int', 'page-size' : 'int', |
57 | - 'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64' } } | |
66 | + 'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64', | |
67 | + 'precopy-bytes' : 'uint64', 'downtime-bytes' : 'uint64', | |
68 | + 'postcopy-bytes' : 'uint64' } } | |
58 | 69 | |
59 | 70 | ## |
60 | 71 | # @XBZRLECacheStats: |