RE: [RFC PATCH v2 14/23] sched/cache: Drop prefer_sibling restriction for llc_balance
From: Jianyong Wu
Date: Tue Sep 01 2026 - 10:05:44 EST
Hi Peter,
> -----Original Message-----
> From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Sent: Tuesday, September 1, 2026 6:29 PM
> To: Jianyong Wu <wujianyong@xxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>; Juri Lelli <juri.lelli@xxxxxxxxxx>;
> Vincent Guittot <vincent.guittot@xxxxxxxxxx>; Chen Yu
> <yu.c.chen@xxxxxxxxx>; Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>; Dietmar
> Eggemann <dietmar.eggemann@xxxxxxx>; Steven Rostedt
> <rostedt@xxxxxxxxxxx>; Ben Segall <bsegall@xxxxxxxxxx>; Mel Gorman
> <mgorman@xxxxxxx>; Valentin Schneider <vschneid@xxxxxxxxxx>; K
> Prateek Nayak <kprateek.nayak@xxxxxxx>; Shrikanth Hegde
> <sshegde@xxxxxxxxxxxxx>; Phil Auld <pauld@xxxxxxxxxx>; Andrew
> Morton <akpm@xxxxxxxxxxxxxxxxxxxx>; David Hildenbrand
> <david@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx;
> jianyong.wu@xxxxxxxxxxx; Yuan Zhong <zhongyuan@xxxxxxxx>; Huangsj
> <huangsj@xxxxxxxx>; Fengyu Wang <wangfengyu@xxxxxxxx>; Zhiwei Ying
> <yingzhiwei@xxxxxxxx>; justin.he@xxxxxxx
> Subject: Re: [RFC PATCH v2 14/23] sched/cache: Drop prefer_sibling
> restriction for llc_balance
>
> On Thu, Aug 27, 2026 at 08:28:07PM +0800, Jianyong Wu wrote:
> > group_llc_balance performs balancing across LLC and NUMA domains.
> > The prefer_sibling constraint unnecessarily limits its scope, so remove
> > this requirement entirely from the branch condition.
> >
> > 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 584297528a9e..5c35a43e5e38 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -13274,9 +13274,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;
>
> Not sure about blanked disable. Maybe only disable when cache aware
> scheduling is present and enabled?
The prefer_sibling bypass is already limited to cache aware scheduling.
group_llc_balance can only be selected when llc_balance() returns true,
and llc_balance() immediately return false when sched aware scheduling
is not active. When CONFIG_SCHED_CACHE is disabled, the corresponding
stub also cannot produce group_llc_balance.
Therefore, the changed branch cannot bypass prefer_sibling when cache
aware scheduling is absent or disabled.
Thanks
Jianyong