Re: [PATCH v3 04/21] sched/cache: Make LLC id continuous
From: Chen, Yu C
Date: Fri Feb 20 2026 - 12:18:33 EST
On 2/20/2026 5:04 AM, Tim Chen wrote:
On Thu, 2026-02-19 at 11:20 -0800, Tim Chen wrote:
On Thu, 2026-02-19 at 23:20 +0800, Chen, Yu C wrote:
On 2/19/2026 10:59 PM, Peter Zijlstra wrote:
On Tue, Feb 10, 2026 at 02:18:44PM -0800, Tim Chen wrote:
[ ... ]
+
+ lid = per_cpu(sd_llc_id, i);
+ if (lid == -1) {
+ int j;
+
+ /*
+ * Assign the llc_id to the CPUs that do not
+ * have an LLC.
+ */
Where does this happen? Is this for things like Atom that don't have an
L3 and so we don't set up a LLC domain?
Yes, for some hybrid platforms, some CPUs on that platforms might not
have L3,
Tim might correct me if I’m wrong. Above code is derived from the
update_top_cache_domain(),
if there is no sched domain with SD_SHARE_LLC, per_cpu(sd_llc_id, cpu)
is set to the
CPU number directly.
That's correct. One example is Meteor Lake where some Atom CPUs don't have
L3 but have only L2. And some Ampere CPUs also have no shared L3.
https://www.spinics.net/lists/kernel/msg5863118.html?utm_source=chatgpt.com
This also reminded me that if we rely on cpu_coregroup_mask for LLC id
assignment, we may be missing out such platforms which need to treat
L2 as the last level cache. So we may need to fallback to cpu_clustergroup_mask
or cpu_smt_mask where applicable.
On further inspection of the code, cpu_coregroup_mask will just be the same
as cpu_clustergroup_mask for that case so we should be okay.
OK, I assume this is true for Intel platforms because the llc_id will
be set to l2_id if there is no L3 cache:
c->topo.llc_id = (l3_id == BAD_APICID) ? l2_id : l3_id;
I suppose AMD platforms should not be impacted because I have not seen
any non-L3 platforms (for AMD).
For non-x86 platforms, cpu_coregroup_mask() will be converted to the
cluster mask if no LLC is present.
thanks,
Chenyu