[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ddf1e4e377ffbacab6a10ffa2e729a0d5e24ad98.camel@linux.intel.com>
Date: Wed, 15 Oct 2025 13:42:49 -0700
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>, K Prateek Nayak
<kprateek.nayak@....com>, "Gautham R . Shenoy" <gautham.shenoy@....com>,
Vincent Guittot <vincent.guittot@...aro.org>, Juri Lelli
<juri.lelli@...hat.com>, Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel
Gorman <mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>,
Madadi Vineeth Reddy <vineethr@...ux.ibm.com>, Hillf Danton
<hdanton@...a.com>, Shrikanth Hegde <sshegde@...ux.ibm.com>, Jianyong Wu
<jianyong.wu@...look.com>, Yangyu Chen <cyy@...self.name>, Tingyin Duan
<tingyin.duan@...il.com>, Vern Hao <vernhao@...cent.com>, Len Brown
<len.brown@...el.com>, Aubrey Li <aubrey.li@...el.com>, Zhao Liu
<zhao1.liu@...el.com>, Chen Yu <yu.chen.surf@...il.com>, Chen Yu
<yu.c.chen@...el.com>, Libo Chen <libo.chen@...cle.com>, Adam Li
<adamli@...amperecomputing.com>, Tim Chen <tim.c.chen@...el.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/19] sched/fair: Count tasks prefering each LLC in a
sched group
On Wed, 2025-10-15 at 14:22 +0200, Peter Zijlstra wrote:
> On Sat, Oct 11, 2025 at 11:24:46AM -0700, Tim Chen wrote:
> > During LLC load balancing, tabulate the number of tasks on each runqueue
> > that prefer a given destination LLC in a sched group.
> >
> > For example, consider a system with 4 LLC sched groups (LLC0 to LLC3)
> > balancing towards LLC3. LLC0 has 3 tasks preferring LLC3, LLC1 has
> > 2, and LLC2 has 1. LLC0, having the most tasks preferring LLC3, is
> > selected as the busiest source to pick tasks from.
> >
> > Within a source LLC, the total number of tasks preferring a destination
> > LLC is computed by summing counts across all CPUs in that runqueue. For
> > instance, if LLC0 has CPU0 with 2 tasks and CPU1 with 1 task preferring
> > LLC3, the total for LLC0 is 3.
> >
> > These statistics allow the load balancer to choose tasks from source
> > sched groups that best match their preferred LLCs.
> >
> > Signed-off-by: Tim Chen <tim.c.chen@...ux.intel.com>
> > ---
> > kernel/sched/fair.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index b7a68fe7601b..cbd1e97bca4b 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -10399,6 +10399,9 @@ struct sg_lb_stats {
> > unsigned int nr_numa_running;
> > unsigned int nr_preferred_running;
> > #endif
> > +#ifdef CONFIG_SCHED_CACHE
> > + unsigned int nr_pref_llc[NR_LLCS];
> > +#endif
> > };
>
> Hahahaha, no! We have this on-stack, this cannot be.
Okay, will allocate it off stack.
Tim
Powered by blists - more mailing lists