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

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