qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC] migration: Introduce migration throttle event
@ 2025-02-18  2:39 yong.huang
  2025-02-18  5:44 ` Markus Armbruster
  2025-02-18 18:15 ` Peter Xu
  0 siblings, 2 replies; 6+ messages in thread
From: yong.huang @ 2025-02-18  2:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Xu, Fabiano Rosas, Eric Blake, Markus Armbruster,
	Hyman Huang

From: Hyman Huang <yong.huang@smartx.com>

When the developer is examining the time distribution of
the migration, it is useful to record the migration throttle
timestamp. Consequently, include the migration throttle event.

Signed-off-by: Hyman Huang <yong.huang@smartx.com>
---
 migration/ram.c     |  1 +
 qapi/migration.json | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/migration/ram.c b/migration/ram.c
index 589b6505eb..725e029927 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -524,6 +524,7 @@ static void mig_throttle_guest_down(uint64_t bytes_dirty_period,
 
     /* We have not started throttling yet. Let's start it. */
     if (!cpu_throttle_active()) {
+        qapi_event_send_migration_throttle();
         cpu_throttle_set(pct_initial);
     } else {
         /* Throttling already on, just increase the rate */
diff --git a/qapi/migration.json b/qapi/migration.json
index 8b9c53595c..0495065b5d 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1393,6 +1393,21 @@
 { 'event': 'MIGRATION_PASS',
   'data': { 'pass': 'int' } }
 
+##
+# @MIGRATION_THROTTLE:
+#
+# Emitted from the source side of a migration at the start of vCPU throttle
+#
+# Since: 10.0
+#
+# Example:
+#
+# <- { "event": "MIGRATION_THROTTLE",
+#      "timestamp": { "seconds": 1267041730, "microseconds": 281295 } }
+#
+##
+{ 'event': 'MIGRATION_THROTTLE' }
+
 ##
 # @COLOMessage:
 #
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-19  1:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-18  2:39 [RFC] migration: Introduce migration throttle event yong.huang
2025-02-18  5:44 ` Markus Armbruster
2025-02-18  6:50   ` Yong Huang
2025-02-18 18:15 ` Peter Xu
2025-02-18 19:21   ` Markus Armbruster
2025-02-19  1:31     ` Yong Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).