From: sashiko-bot@kernel.org
To: "Troy Mitchell" <troy.mitchell@linux.dev>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH RFC 1/3] arch_topology: Add a die level to CPU topology
Date: Sun, 20 Sep 2026 03:25:54 +0000 [thread overview]
Message-ID: <20260920032555.027781F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260920-riscv-die-topology-rfc-v1-1-071c0bf61d5f@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] arch_topology: missing generic die topology API macros
--
commit 6649d6f4ff943b18e39749fa5d7c01258bf6f28c
Author: Troy Mitchell <troy.mitchell@linux.dev>
arch_topology: Add a die level to CPU topology
This commit introduces a die level to the generic CPU topology model by adding
die identifiers and sibling masks between the package and cluster levels.
Die sibling masks are built when firmware supplies a valid identifier,
otherwise falling back to an unknown die.
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 8c5e47c28d9a3..ee82827be3351 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
[ ... ]
> @@ -824,6 +836,8 @@ void remove_cpu_topology(unsigned int cpu)
> cpumask_clear_cpu(cpu, topology_sibling_cpumask(sibling));
> for_each_cpu(sibling, topology_cluster_cpumask(cpu))
> cpumask_clear_cpu(cpu, topology_cluster_cpumask(sibling));
> + for_each_cpu(sibling, &cpu_topology[cpu].die_sibling)
> + cpumask_clear_cpu(cpu, &cpu_topology[sibling].die_sibling);
[Severity: Medium]
Why does this access the raw cpu_topology struct directly?
The surrounding code uses macros like topology_cluster_cpumask() to retrieve
the sibling masks. Since the patch adds die_sibling, should there be a
matching topology_die_cpumask() macro exported for consistent access?
> for_each_cpu(sibling, topology_llc_cpumask(cpu))
> cpumask_clear_cpu(cpu, topology_llc_cpumask(sibling));
[ ... ]
> diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h
> index ebd7f8935f969..2a5591bb95075 100644
> --- a/include/linux/arch_topology.h
> +++ b/include/linux/arch_topology.h
> @@ -63,10 +63,12 @@ struct cpu_topology {
> int thread_id;
> int core_id;
> int cluster_id;
> + int die_id;
> int package_id;
> cpumask_t thread_sibling;
> cpumask_t core_sibling;
> cpumask_t cluster_sibling;
> + cpumask_t die_sibling;
> cpumask_t llc_sibling;
> };
[Severity: Medium]
Are we missing the corresponding generic macro definitions for the new die
topology API?
While die_id and die_sibling are added to the structure here and computed
internally, the standard generic topology accessors (like topology_die_cpumask
and topology_die_id) are omitted from this generic header.
Without these definitions in the generic header, do architectures utilizing
generic topology (such as ARM64) silently fall back to the dummy defaults
in <linux/topology.h>?
If these macros are only defined later in an architecture-specific header
(such as RISC-V in a follow-up patch), it leaves the generic API abstraction
broken. The newly computed die boundaries would remain functionally
inaccessible and completely hidden from sysfs and the scheduler on other
architectures like ARM64.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260920-riscv-die-topology-rfc-v1-0-071c0bf61d5f@linux.dev?part=1
next prev parent reply other threads:[~2026-09-20 3:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 3:18 [PATCH RFC 0/3] riscv: Add explicit die-level CPU topology Troy Mitchell
2026-09-20 3:18 ` [PATCH RFC 1/3] arch_topology: Add a die level to " Troy Mitchell
2026-09-20 3:25 ` sashiko-bot [this message]
2026-09-20 3:18 ` [PATCH RFC 2/3] arch_topology: Parse die nodes in /cpu-map Troy Mitchell
2026-09-21 11:14 ` Sudeep Holla
2026-09-22 8:06 ` Troy Mitchell
2026-09-20 3:18 ` [PATCH RFC 3/3] riscv: topology: Expose explicit CPU die topology Troy Mitchell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260920032555.027781F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=troy.mitchell@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox