62 lines
2.4 KiB
Diff
62 lines
2.4 KiB
Diff
|
|
From 0f564d8940367ccdfb39b33be048f1b85e097e89 Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
|
||
|
|
<yong.huang@smartx.com>
|
||
|
|
Date: Thu, 15 Jun 2023 21:29:44 +0800
|
||
|
|
Subject: [PATCH] migration: Put the detection logic before auto-converge
|
||
|
|
checking
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
This commit is prepared for the implementation of dirty-limit
|
||
|
|
convergence algo.
|
||
|
|
|
||
|
|
The detection logic of throttling condition can apply to both
|
||
|
|
auto-converge and dirty-limit algo, putting it's position
|
||
|
|
before the checking logic for auto-converge feature.
|
||
|
|
|
||
|
|
Signed-off-by: Hyman Huang(黄勇) <yong.huang@smartx.com>
|
||
|
|
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
||
|
|
Message-ID: <168733225273.5845.15871826788879741674-6@git.sr.ht>
|
||
|
|
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
||
|
|
---
|
||
|
|
migration/ram.c | 21 +++++++++++----------
|
||
|
|
1 file changed, 11 insertions(+), 10 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/migration/ram.c b/migration/ram.c
|
||
|
|
index 87e551913c..20f228e6bb 100644
|
||
|
|
--- a/migration/ram.c
|
||
|
|
+++ b/migration/ram.c
|
||
|
|
@@ -1415,17 +1415,18 @@ static void migration_trigger_throttle(RAMState *rs)
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
- if (migrate_auto_converge()) {
|
||
|
|
- /* The following detection logic can be refined later. For now:
|
||
|
|
- Check to see if the ratio between dirtied bytes and the approx.
|
||
|
|
- amount of bytes that just got transferred since the last time
|
||
|
|
- we were in this routine reaches the threshold. If that happens
|
||
|
|
- twice, start or increase throttling. */
|
||
|
|
-
|
||
|
|
- if ((bytes_dirty_period > bytes_dirty_threshold) &&
|
||
|
|
- (++rs->dirty_rate_high_cnt >= 2)) {
|
||
|
|
+ /*
|
||
|
|
+ * The following detection logic can be refined later. For now:
|
||
|
|
+ * Check to see if the ratio between dirtied bytes and the approx.
|
||
|
|
+ * amount of bytes that just got transferred since the last time
|
||
|
|
+ * we were in this routine reaches the threshold. If that happens
|
||
|
|
+ * twice, start or increase throttling.
|
||
|
|
+ */
|
||
|
|
+ if ((bytes_dirty_period > bytes_dirty_threshold) &&
|
||
|
|
+ (++rs->dirty_rate_high_cnt >= 2)) {
|
||
|
|
+ rs->dirty_rate_high_cnt = 0;
|
||
|
|
+ if (migrate_auto_converge()) {
|
||
|
|
trace_migration_throttle();
|
||
|
|
- rs->dirty_rate_high_cnt = 0;
|
||
|
|
mig_throttle_guest_down(bytes_dirty_period,
|
||
|
|
bytes_dirty_threshold);
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|