[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a31003cc-fabd-4c18-9603-7763ec1e92ea@linux.ibm.com>
Date: Tue, 21 Oct 2025 13:58:39 +0530
From: Madadi Vineeth Reddy <vineethr@...ux.ibm.com>
To: Tim Chen <tim.c.chen@...ux.intel.com>
Cc: Peter Zijlstra <peterz@...radead.org>, 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>,
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,
Madadi Vineeth Reddy <vineethr@...ux.ibm.com>
Subject: Re: [PATCH 08/19] sched/fair: Introduce per runqueue task LLC
preference counter
On 16/10/25 02:11, Tim Chen wrote:
> On Wed, 2025-10-15 at 14:21 +0200, Peter Zijlstra wrote:
>> On Sat, Oct 11, 2025 at 11:24:45AM -0700, Tim Chen wrote:
>>> Each runqueue is assigned a static array where each element tracks
>>> the number of tasks preferring a given LLC, indexed from 0 to
>>> NR_LLCS.
>>>
[snip]
>>
>>>
>>> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
>>> index 3ab64067acc6..b801d32d5fba 100644
>>> --- a/kernel/sched/sched.h
>>> +++ b/kernel/sched/sched.h
>>> @@ -1101,6 +1101,7 @@ struct rq {
>>> #ifdef CONFIG_SCHED_CACHE
>>> unsigned int nr_pref_llc_running;
>>> unsigned int nr_llc_running;
>>> + unsigned int nr_pref_llc[NR_LLCS];
>>
>> Gah, yeah, lets not do this. Just (re)alloc the thing on topology
>> changes or something.
>
> Will have to think about how to keep the tasks' preference
> consistent with nr_pref_llc with the new array. Perhaps
> make it size of NR_CPUS so we will allocate
> once and don't have to resize and reallocate it, and
> fill it back up with the right data.
>
> Tim
IIUC, what Peter meant is to dynamically allocate the array size based on
the actual number of LLCs computed in build_sched_domains() or somesuch
rather than statically allocating NR_LLCS which is 64 by default.
Making it NR_CPUS would be even larger and waste more memory on systems
with few LLCs.
Thanks,
Madadi Vineeth Reddy
Powered by blists - more mailing lists