Blame SOURCES/kvm-Add-dirty-sync-missed-zero-copy-migration-stat.patch

0727d3
From cd49a32e9c9e33efc51652b68180a07683814b4d Mon Sep 17 00:00:00 2001
0727d3
From: Leonardo Bras <leobras@redhat.com>
0727d3
Date: Mon, 11 Jul 2022 18:11:12 -0300
0727d3
Subject: [PATCH 4/9] Add dirty-sync-missed-zero-copy migration stat
0727d3
MIME-Version: 1.0
0727d3
Content-Type: text/plain; charset=UTF-8
0727d3
Content-Transfer-Encoding: 8bit
0727d3
0727d3
RH-Author: Leonardo Brás <leobras@redhat.com>
0727d3
RH-MergeRequest: 201: Zero-copy-send fixes + improvements
0727d3
RH-Commit: [4/8] 56cce61cf95aafc8dafae7531b43c166084abfec
0727d3
RH-Bugzilla: 2110203
0727d3
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
0727d3
RH-Acked-by: Peter Xu <peterx@redhat.com>
0727d3
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
0727d3
0727d3
Signed-off-by: Leonardo Bras <leobras@redhat.com>
0727d3
Acked-by: Markus Armbruster <armbru@redhat.com>
0727d3
Acked-by: Peter Xu <peterx@redhat.com>
0727d3
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
0727d3
Message-Id: <20220711211112.18951-3-leobras@redhat.com>
0727d3
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
0727d3
(cherry picked from commit cf20c897338067ab4b70a4596fdccaf90c7e29a1)
0727d3
Signed-off-by: Leonardo Bras <leobras@redhat.com>
0727d3
---
0727d3
 migration/migration.c | 2 ++
0727d3
 monitor/hmp-cmds.c    | 5 +++++
0727d3
 qapi/migration.json   | 7 ++++++-
0727d3
 3 files changed, 13 insertions(+), 1 deletion(-)
0727d3
0727d3
diff --git a/migration/migration.c b/migration/migration.c
0727d3
index e100b30f00..952a26c5c2 100644
0727d3
--- a/migration/migration.c
0727d3
+++ b/migration/migration.c
0727d3
@@ -1012,6 +1012,8 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
0727d3
     info->ram->normal_bytes = ram_counters.normal * page_size;
0727d3
     info->ram->mbps = s->mbps;
0727d3
     info->ram->dirty_sync_count = ram_counters.dirty_sync_count;
0727d3
+    info->ram->dirty_sync_missed_zero_copy =
0727d3
+            ram_counters.dirty_sync_missed_zero_copy;
0727d3
     info->ram->postcopy_requests = ram_counters.postcopy_requests;
0727d3
     info->ram->page_size = page_size;
0727d3
     info->ram->multifd_bytes = ram_counters.multifd_bytes;
0727d3
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
0727d3
index 8c384dc1b2..f7216ab5d0 100644
0727d3
--- a/monitor/hmp-cmds.c
0727d3
+++ b/monitor/hmp-cmds.c
0727d3
@@ -305,6 +305,11 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
0727d3
             monitor_printf(mon, "postcopy ram: %" PRIu64 " kbytes\n",
0727d3
                            info->ram->postcopy_bytes >> 10);
0727d3
         }
0727d3
+        if (info->ram->dirty_sync_missed_zero_copy) {
0727d3
+            monitor_printf(mon,
0727d3
+                           "Zero-copy-send fallbacks happened: %" PRIu64 " times\n",
0727d3
+                           info->ram->dirty_sync_missed_zero_copy);
0727d3
+        }
0727d3
     }
0727d3
 
0727d3
     if (info->has_disk) {
0727d3
diff --git a/qapi/migration.json b/qapi/migration.json
0727d3
index c8ec260ab0..94bc5c69db 100644
0727d3
--- a/qapi/migration.json
0727d3
+++ b/qapi/migration.json
0727d3
@@ -55,6 +55,10 @@
0727d3
 # @postcopy-bytes: The number of bytes sent during the post-copy phase
0727d3
 #                  (since 7.0).
0727d3
 #
0727d3
+# @dirty-sync-missed-zero-copy: Number of times dirty RAM synchronization could
0727d3
+#                               not avoid copying dirty pages. This is between
0727d3
+#                               0 and @dirty-sync-count * @multifd-channels.
0727d3
+#                               (since 7.1)
0727d3
 # Since: 0.14
0727d3
 ##
0727d3
 { 'struct': 'MigrationStats',
0727d3
@@ -65,7 +69,8 @@
0727d3
            'postcopy-requests' : 'int', 'page-size' : 'int',
0727d3
            'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64',
0727d3
            'precopy-bytes' : 'uint64', 'downtime-bytes' : 'uint64',
0727d3
-           'postcopy-bytes' : 'uint64' } }
0727d3
+           'postcopy-bytes' : 'uint64',
0727d3
+           'dirty-sync-missed-zero-copy' : 'uint64' } }
0727d3
 
0727d3
 ##
0727d3
 # @XBZRLECacheStats:
0727d3
-- 
0727d3
2.31.1
0727d3