Devicetree
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] riscv: Add explicit die-level CPU topology
@ 2026-09-20  3:18 Troy Mitchell
  2026-09-20  3:18 ` [PATCH RFC 1/3] arch_topology: Add a die level to " Troy Mitchell
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Troy Mitchell @ 2026-09-20  3:18 UTC (permalink / raw)
  To: Sudeep Holla, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti
  Cc: Catalin Marinas, Will Deacon, Mark Rutland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-kernel, driver-core,
	linux-riscv, linux-arm-kernel, devicetree, Troy Mitchell

The generic arch_topology model has no die level. Systems with multiple
dies in one package must flatten their clusters or report each die as a
separate package, losing the die or package boundary.

This RFC adds a die ID and sibling mask to arch_topology, parses optional
dieN nodes in DT cpu-map, and exposes die topology through sysfs on RISC-V.
Clusters can be numbered independently within each die.

The RISC-V sysfs behavior is:

  - An explicit dieN node supplies a non-negative die ID within its package
    and a die sibling mask. RISC-V exposes die_id, die_cpus, and
    die_cpus_list.
  - A DT without dieN keeps die_id at -1 and creates no die sysfs files.
    Package and cluster parsing is unchanged.
  - ACPI die discovery is not implemented. The ACPI and fallback paths
    also leave die_id at -1 and create no die sysfs files.

The DT parser is shared by arm64 and RISC-V, so both record dieN nodes
internally. Only RISC-V exposes the die sysfs files in this series. If you
think I should enable this for arm64 as well, please let me know.

The sysfs visibility hook defaults to visible on other architectures,
including powerpc configurations that report die_id as -1. Their existing
sysfs behavior is unchanged.

The dieN hierarchy is a proposed extension to the DT cpu-map binding.
This RFC does not include a schema update. I'd like feedback on the
topology model and sysfs interface before sending the binding update.

Does placing dieN between socket and cluster make sense? I'd also
appreciate feedback on keeping unspecified dies at -1 and on the sysfs
visibility hook.

Tested with W=1 builds of the affected objects for RISC-V, arm64, and ARM,
and with a complete RISC-V Image build. On a 32-CPU QEMU virt guest, a DT
describing one package with two dies, four clusters per die, and four
cores per cluster exposed the expected IDs and masks and updated them
across CPU offline/online. The same guest with a legacy DT exposed no die
sysfs files while retaining package and cluster topology.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.dev>
---
Troy Mitchell (3):
      arch_topology: Add a die level to CPU topology
      arch_topology: Parse die nodes in /cpu-map
      riscv: topology: Expose explicit CPU die topology

 arch/riscv/include/asm/topology.h |  4 +++
 drivers/base/arch_topology.c      | 68 +++++++++++++++++++++++++++++++--------
 drivers/base/topology.c           | 28 +++++++++++++++-
 include/linux/arch_topology.h     |  2 ++
 include/linux/topology.h          |  3 ++
 5 files changed, 91 insertions(+), 14 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260904-riscv-die-topology-rfc-c009f6e4be92

Best regards,
--  
Troy Mitchell <troy.mitchell@linux.dev>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-22  8:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox