[RFC PATCH v3 11/17] sched/cache: Drop prefer_sibling restriction for llc_balance

From: Jianyong Wu

Date: Wed Oct 28 2026 - 22:33:35 EST


group_llc_balance performs balancing across LLC and NUMA domains.
sched_balance_find_src_group() forces balancing for it only when the
busiest group's child domain prefers siblings. However, sd_init() clears
SD_PREFER_SIBLING on NUMA domains. On systems with multiple NUMA levels,
prefer_sibling is therefore false at the upper NUMA levels, whose groups
are NUMA domains themselves, and cache-aware aggregation cannot force
tasks across those groups, e.g. between sockets.

Force balancing for group_llc_balance whenever the local group has spare
capacity, regardless of prefer_sibling. Keep the prefer_sibling
requirement for the sibling_imbalance() path.

Signed-off-by: Jianyong Wu <wujianyong@xxxxxxxx>
---
kernel/sched/fair.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e9a803433b16..03bb5c85a8b7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -13334,9 +13334,9 @@ static struct sched_group *sched_balance_find_src_group(struct lb_env *env)
* Try to move all excess tasks to a sibling domain of the busiest
* group's child domain.
*/
- if (sds.prefer_sibling && local->group_type == group_has_spare &&
- (busiest->group_type == group_llc_balance ||
- sibling_imbalance(env, &sds, busiest, local) > 1))
+ if (local->group_type == group_has_spare &&
+ ((busiest->group_type == group_llc_balance) || (sds.prefer_sibling &&
+ sibling_imbalance(env, &sds, busiest, local) > 1)))
goto force_balance;

if (busiest->group_type != group_overloaded) {
--
2.34.1