thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

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