linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] DT: Enable sharing resources for SMT threads
@ 2025-05-12  8:07 Alireza Sanaee
  2025-05-12  8:07 ` [PATCH v3 1/7] of: add infra for finding CPU id from phandle Alireza Sanaee
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Alireza Sanaee @ 2025-05-12  8:07 UTC (permalink / raw)
  To: devicetree
  Cc: robh, alireza.sanaee, jonathan.cameron, linux-arm-kernel,
	linux-kernel, linuxarm, mark.rutland, shameerali.kolothum.thodi,
	krzk, dianders, catalin.marinas, suzuki.poulose, mike.leach,
	james.clark, linux-perf-users, coresight, gshan, ruanjinjie,
	saravanak

This patchset allows for sharing resources between SMT threads in the
device tree (DT).

WHY? Given the current use of the DT, it is not possible to share L1
caches, as well as other resources such as clock among SMT threads.
However, DT spec in section Section 3.8.1 [1], describes how SMT threads
can be described in the reg array, this is how PowerPC describes SMT
threads in DT.

CHALLENGE: Given discussions with the community [2], it was apparent
that it is not straightforward to implement this, since cpu-maps must
point to a particular CPU node in DT [3], Section 2.1. However, it is
not only the cpu-map but also there other nodes that point to cpu nodes
which indeed need care and changes.

SOLUTION: This led to more discussions on what the solution should look
like and based on recent conversations we ended up with the following
approach [4].

core0 {
  thread0 {
    cpu = <&cpu0 0>;
  };
  thread1 {
    cpu = <&cpu0 1>;
  };
};

In this layout, first parameter is the phandle to cpu-node and second
index would be the local-thread index in the reg array available in the
cpu-node reg property.

SIDE-NOTE: This patchset does not change any bindings, so I am not
including anything in this patchset.

[1] https://github.com/devicetree-org/devicetree-specification/releases/download/v0.4/devicetree-specification-v0.4.pdf
[2] https://lore.kernel.org/linux-arm-kernel/Z4FJZPRg75YIUR2l@J2N7QTR9R3/
[3] https://www.kernel.org/doc/Documentation/devicetree/bindings/cpu/cpu-topology.txt
[4] https://lore.kernel.org/devicetree-spec/CAL_JsqK1yqRLD9B+G7UUp=D8K++mXHq0Rmv=1i6DL_jXyZwXAw@mail.gmail.com/

PRIOR VERSIONs:
   [V1] https://lore.kernel.org/all/20250422084340.457-1-alireza.sanaee@huawei.com/
   [V2] https://lore.kernel.org/all/20250502161300.1411-1-alireza.sanaee@huawei.com/

CHANGE LOG:
    V2 -> V3:
        * I got the V2 completely wrong, so I updated it.
        * Re-introduce #cpu-cells property.
    V1 -> V2:
        * Address Rob's comments.
            ** Re-order patches.
            ** Fix bugs.
        * Remove #cpu-cells property

Alireza Sanaee (7):
  of: add infra for finding CPU id from phandle
  arch_topology: update CPU map to use the new API
  coresight: cti: Use of_cpu_phandle_to_id for grabbing CPU id
  coresight: Use of_cpu_phandle_to_id for grabbing CPU id
  perf/arm-dsu: refactor cpu id retrieval via new API
    of_cpu_phandle_to_id
  arm64: of: handle multiple threads in ARM cpu node
  of: of_cpu_phandle_to_id to support SMT threads

 arch/arm64/kernel/smp.c                       | 74 ++++++++++---------
 drivers/base/arch_topology.c                  | 12 +--
 .../coresight/coresight-cti-platform.c        | 15 +---
 .../hwtracing/coresight/coresight-platform.c  | 14 +---
 drivers/of/cpu.c                              | 56 +++++++++++++-
 drivers/perf/arm_dsu_pmu.c                    |  6 +-
 include/linux/of.h                            |  9 +++
 7 files changed, 118 insertions(+), 68 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-06-06 14:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12  8:07 [PATCH v3 0/7] DT: Enable sharing resources for SMT threads Alireza Sanaee
2025-05-12  8:07 ` [PATCH v3 1/7] of: add infra for finding CPU id from phandle Alireza Sanaee
2025-05-28 15:54   ` Jonathan Cameron
2025-05-12  8:07 ` [PATCH v3 2/7] arch_topology: update CPU map to use the new API Alireza Sanaee
2025-05-12  8:07 ` [PATCH v3 3/7] coresight: cti: Use of_cpu_phandle_to_id for grabbing CPU id Alireza Sanaee
2025-05-12  8:07 ` [PATCH v3 4/7] coresight: " Alireza Sanaee
2025-05-12  8:07 ` [PATCH v3 5/7] perf/arm-dsu: refactor cpu id retrieval via new API of_cpu_phandle_to_id Alireza Sanaee
2025-05-12  8:07 ` [PATCH v3 6/7] arm64: of: handle multiple threads in ARM cpu node Alireza Sanaee
2025-05-12  8:07 ` [PATCH v3 7/7] of: of_cpu_phandle_to_id to support SMT threads Alireza Sanaee
2025-06-06 14:18   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).