Re: [PATCH 19/19] sched/fair: Add user control to adjust the tolerance of cache-aware scheduling
From: Chen, Yu C
Date: Wed Oct 29 2025 - 08:54:41 EST
On 10/29/2025 4:07 PM, Aaron Lu wrote:
On Sat, Oct 11, 2025 at 11:24:56AM -0700, Tim Chen wrote:
... ...
+static inline int get_sched_cache_cap_scale(void)... ...
+{
+ return (llc_overload_pct / cpu_smt_num_threads);
+}
+
@@ -9749,7 +9811,7 @@ static inline int task_is_ineligible_on_dst_cpu(struct task_struct *p, int dest_
* (default: ~50%)
*/
#define fits_llc_capacity(util, max) \
- ((util) * 100 < (max) * llc_overload_pct)
+ ((util) * 100 < (max) * get_sched_cache_cap_scale())
With this change, fits_llc_capacity() would be false if util is just 1/4
of max(which is llc's total cpu capacity), is this intended?
Yes, it was changed to this because we want to avoid performance regressions
in some systems with a large number of SMTs per core-aggressive task aggregation
is harmful to those systems. However, upon further thought, since we have a
user-space knob to control how aggressively users want to enable task aggregation,
we can try removing cpu_smt_num_threads and let users decide. I'll do some
tests to check the impact.
thanks,
Chenyu