lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1540b472-b5b4-4e10-af88-816cc256931b@intel.com>
Date: Wed, 29 Oct 2025 20:36:38 +0800
From: "Chen, Yu C" <yu.c.chen@...el.com>
To: Tim Chen <tim.c.chen@...ux.intel.com>
CC: 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>, Adam Li <adamli@...amperecomputing.com>, Tim Chen
	<tim.c.chen@...el.com>, <linux-kernel@...r.kernel.org>, Peter Zijlstra
	<peterz@...radead.org>, "Gautham R . Shenoy" <gautham.shenoy@....com>, "Ingo
 Molnar" <mingo@...hat.com>, K Prateek Nayak <kprateek.nayak@....com>
Subject: Re: [PATCH 04/19] sched/fair: Introduce a static key to enable cache
 aware only for multi LLCs

On 10/28/2025 7:36 AM, Tim Chen wrote:
> On Mon, 2025-10-27 at 20:56 +0800, Chen, Yu C wrote:
>> Hi Prateek,
>>
>> On 10/27/2025 1:42 PM, K Prateek Nayak wrote:
>>> Hello Tim,
>>>
>>> On 10/11/2025 11:54 PM, Tim Chen wrote:
>>>> @@ -2530,10 +2531,12 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att
>>>>    				 * between LLCs and memory channels.
>>>>    				 */
>>>>    				nr_llcs = sd->span_weight / child->span_weight;
>>>> -				if (nr_llcs == 1)
>>>> +				if (nr_llcs == 1) {
>>>>    					imb = sd->span_weight >> 3;
>>>> -				else
>>>> +				} else {
>>>>    					imb = nr_llcs;
>>>> +					has_multi_llcs = true;
>>>
>>> One caution: this will not hold if all the CPUs aren't online during boot.
>>> One case I can think of is when the kernel is booted with "maxcpus" cmdline
>>> and CPUs are hotplugged later.
>>>
>>> Unfortunately, I don't think we even have the raw topology data from the
>>> arch/ side under such scenario to accurately make a call if the system
>>> contains single or multiple LLC :(
>>>
>>> I'm not sure if it is feasible but assuming the task_work() cannot run if
>>> &sched_cache_allowed is false, can the fist instance of the task work for
>>> sched_cache do the necessary setup?
>>>
>>
>> build_sched_domains() might get invoked to rebuild the corresponding sched
>> domains during CPU hotplug via cpuset subsystem. So if the CPU gets online
>> after bootup, we still have the chance to detect multiple LLCs I suppose?
> 
> The case Pratek brought up of adding CPUs and enabling SCHED_CACHE
> should be covered.
> 
> The trickier case is if we disable SCHED_CACHE when CPUs are
> offlined and multi_cpus becomes false.  We'll need to clear out rq->nr_pref_llcs
> data and tasks' preferred LLC would need to be cleared.  Or else the accounting
> could be skewed we bring CPU online later and again re-enable SCHED_CACHE.

To safely keep the data consistent, do we need to add hook when 
SCHED_CACHE is
disabled at runtime, to clear all the stale data? In that way, another
race condition between SCHED_CACHE enabling vs EQ/DQ might also be covered.

thanks,
Chenyu
> So far we haven't done that when we disable SCHED_CACHE from an enabled state.
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ