[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95cb85d9-f018-4e71-88bc-f4129227bcf2@intel.com>
Date: Thu, 16 Oct 2025 00:27:55 +0800
From: "Chen, Yu C" <yu.c.chen@...el.com>
To: Peter Zijlstra <peterz@...radead.org>, Tim Chen
<tim.c.chen@...ux.intel.com>
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>, Adam Li <adamli@...amperecomputing.com>, Tim Chen
<tim.c.chen@...el.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 02/19] sched/fair: Record per-LLC utilization to guide
cache-aware scheduling decisions
On 10/15/2025 6:15 PM, Peter Zijlstra wrote:
> On Sat, Oct 11, 2025 at 11:24:39AM -0700, Tim Chen wrote:
>> +static void record_sg_llc_stats(struct lb_env *env,
>> + struct sg_lb_stats *sgs,
>> + struct sched_group *group)
>> +{
>> + /*
>> + * Find the child domain on env->dst_cpu. This domain
>> + * is either the domain that spans this group(if the
>> + * group is a local group), or the sibling domain of
>> + * this group.
>> + */
>> + struct sched_domain *sd = env->sd->child;
>> + struct sched_domain_shared *sd_share;
>> +
>> + if (!sched_feat(SCHED_CACHE) || env->idle == CPU_NEWLY_IDLE)
>> + return;
>> +
>> + /* only care about sched domains spanning a LLC */
>> + if (sd != rcu_dereference(per_cpu(sd_llc, env->dst_cpu)))
>> + return;
>> +
>> + /*
>> + * At this point we know this group spans a LLC domain.
>> + * Record the statistic of this group in its corresponding
>> + * shared LLC domain.
>> + */
>> + sd_share = rcu_dereference(per_cpu(sd_llc_shared,
>> + cpumask_first(sched_group_span(group))));
>
> Isn't this sd->shared ? Or did I loose the plot somewhere?
>
The sd here refers to the domain that covers the local_group,
which is derived from env->dst_cpu. Meanwhile, sd_share corresponds
to the domain covering the 'group' that may be a sibling of the local_group.
Our goal is to update the statistics of this latter 'group'. It is assumed
that the local_group and its sibling 'group' have the same CPU weight,
meaning they each cover one LLC. We check sd simply because it is the
only domain we can obtain via env->sd->child (apologies, but I haven’t
found a way to get the corresponding domain that spans the 'group' itself).
thanks,
Chenyu
Powered by blists - more mailing lists