[PATCH 2/2] sched/cache: Fix decision matrix comment above can_migrate_llc()
From: Tim Chen
Date: Thu Nov 12 2026 - 13:47:57 EST
The example tables in the comment did not match what the function
computes with the default thresholds. The imbalance test is a ratio,
so 50% is noticeably busier than 40% (25% above), and several cells
were wrong: 40%->60% toward the preferred LLC is forbidden, 50%->30%
out of the preferred LLC is allowed, and 60%->40% out is allowed.
Use 45% instead of 40% so the tables also illustrate the imb_pct
hysteresis, and recompute every cell from the code.
Fixes: 23b2b5ccc45ce ("sched/cache: Introduce helper functions to enforce LLC migration policy")
Cc: stable@xxxxxxxxxxxxxxx # v7.2.y v7.3.y
Co-developed-by: Chen Yu <yu.c.chen@xxxxxxxxx>
Signed-off-by: Chen Yu <yu.c.chen@xxxxxxxxx>
Signed-off-by: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>
---
kernel/sched/fair.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index cfc982205b98..5770ae37d1dc 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -10837,20 +10837,20 @@ static __maybe_unused bool get_llc_stats(int cpu, unsigned long *util,
* 1. moving towards the preferred LLC, dst is the preferred
* LLC, src is not.
*
- * src \ dst 30% 40% 50% 60%
- * 30% Y Y Y N
- * 40% Y Y Y Y
+ * src \ dst 30% 45% 50% 60%
+ * 30% Y Y N N
+ * 45% Y Y Y N
* 50% Y Y G G
* 60% Y Y G G
*
* 2. moving out of the preferred LLC, src is the preferred
* LLC, dst is not:
*
- * src \ dst 30% 40% 50% 60%
+ * src \ dst 30% 45% 50% 60%
* 30% N N N N
- * 40% N N N N
- * 50% N N G G
- * 60% Y N G G
+ * 45% N N N N
+ * 50% Y N G G
+ * 60% Y Y G G
*
* src : src_util
* dst : dst_util
--
2.32.0