Skip to content

arm64: dts: apple: t6050: Give the M and P cores their capacities - #1399

Merged
DjDeveloperr merged 2 commits into
integration/aurorafrom
djdev/t6050-cpu-capacity
Nov 10, 2026
Merged

DjDeveloperr merged 2 commits into
integration/aurorafrom
djdev/t6050-cpu-capacity

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

On the M5 Pro (J714s) every CPU reports cpu_capacity 1024, so the scheduler can't tell the six P cores (apple,everest, CPUs 12-17) from the twelve M cores (apple,sawtooth). An unpinned single heavy thread lands on an M core most of the time (4 of 5 runs), and CPU-bound GPU benchmarks swing 16-33 % between runs, depending on which cluster the submitting thread lands on.

Two commits:

  • arm64: dts: apple: t6050: Describe the CPU clusters: a cpu-map for the T6050 Max (one die): clusters 0 and 1 are the M clusters (MPIDR Aff1 0, 1) and cluster 2 is the P cluster, each with its own L2 (ADT l2-cache-id, cluster-type). parse_dt_topology() reads capacity-dmips-mhz only while it walks cpu-map, so without one no capacity reaches the scheduler. A first test with the capacities alone left every CPU at 1024, which is how this showed up. The boot loader prunes cpu-map entries of cores it didn't start. The two-die description (t6050-ultra.dtsi) keeps its flat layout; I couldn't test it here.
  • arm64: dts: apple: t6050: Give the M and P cores their capacities: M 794, P 1024.

How the values were measured (J714sAP, 7.3.0-m5-argb)

Pinned single-thread throughput with every cluster at 4284 MHz, which both OPP tables have. Each core's clock comes from a dependent-add chain (M0 4.336, M1 4.285, P 4.272 GHz), and rates are divided by it:

workload M per MHz / P per MHz
zstd -3 compression (212 MB of libLLVM) 0.736
zstd decompression 0.871
Python dict loop (3 M iterations) 0.728
geometric mean → M capacity-dmips-mhz 0.776 → 794
L1/L2-resident loops: 8-stream xorshift, branchy table, qsort, hash table, 48×48 FP matmul, 1 MiB copy 0.97, 0.96, 0.96, 0.92, 0.97, 1.01

The small loops show that both cores have the same execution resources for simple code, but they don't tell how general code runs, so the value comes from the three real workloads. With the 4380 MHz (M) and 4608 MHz (P) tops, the M cores' capacity is 1024 × 794 × 4380 / (1024 × 4608) = 754.

Results on the M5

Default SSD boot (7.3.0-m5-argb) against the same kernel with only this DTB, installed over SSH in one session (run capb2, 2026-11-09 19:38-19:48), then rolled back:

  • Capacities: before, all 18 CPUs at 1024 with no clusters. After, CPUs 0-11 at 754 and 12-17 at 1024, clusters 0-5 / 6-11 / 12-17 (cluster_id 0, 1, 2).
  • An unpinned single-thread hog (12 s, CPU sampled every 0.25 s): on CPUs 12-17 in 1 of 5 runs before, 5 of 5 after.
  • gpubench spread over 6 runs per test (max-min over mean; share of samples on CPUs 12-17):
test unpinned before unpinned after pinned to 12-17 before pinned after
submit.empty d1 9.3 % (79 % on P) 0.6 % (100 %) 1.2 % 3.1 %
render.light tri d4 36.8 % (26 %) 5.7 % (100 %) 7.5 % 0.4 %
compute.heavy bw d8 (GPU-bound) 0.1 % 0.2 % 0.0 % 0.4 %
compute.light d4 23.9 % (36 %) 24.2 % (65 %) 38.0 % 9.3 %

The single-threaded submit paths now stay on P cores, and their unpinned spread falls to the pinned level. The GPU-bound test doesn't change. compute.light is multi-threaded and noisy even when pinned, and part of it still runs on M cores; its unpinned spread doesn't drop.

  • Health: no oops/BUG/WARN/SError, the desktop (Hyprland) up on both sets, and the only error lines are HID "no listeners" notes (as on the default set, plus one for a USB HID device that enumerated on that boot). After the rollback, current is 7.3.0-m5-argb again.

Energy model

Not added. apple-soc-cpufreq registers one only from OPP power data (opp-microwatt or a power coefficient), and the T6050 tables have none. I measured one busy core's SMC total-system-power increase at every OPP (idle about 7.0 W with the desktop running):

  • At equal clock (4284 MHz) an M core costs 5.5 W and a P core 8.5 W.
  • At equal performance the two cost about the same. For 0.5 × P_max: P at 2292 MHz 2.70 W, M at 2964 MHz 2.71 W. For 0.3 × P_max: 1.44 W and 1.46 W.
  • Above the M cores' ceiling only P can run, and there P is cheaper: 0.74 × P_max is 5.1 W at P 3432 MHz against 5.8 W at M 4380 MHz.

So EAS would mostly choose the same cores the capacities already lead to. With single samples of whole-system power, the data doesn't justify an energy model yet.

Testing

  • All 11 T6050 board DTBs build with dtc, with no warnings in the default set. J714s gets 12 × 794 and 6 × 1024, plus the cpu-map.
  • The test DTB is the M5's default integration DT compiled on the argb kernel's tree with these two files. It differs from the default DTB only by the cpu-map, the 18 capacities and the CPU nodes' phandles.

🤖 Generated with Claude Code

The T6050 Max CPU nodes had no cpu-map, so Linux sees eighteen CPUs in
one package with no clusters. parse_dt_topology() also reads each CPU's
capacity-dmips-mhz only while it walks cpu-map, so without one no
capacity reaches the scheduler. Describe the three clusters as the ADT
does: MPIDR Aff1 0 and 1 are the M clusters, 2 the P cluster, each with
its own L2. The boot loader prunes the entries of cores it did not
start. The two-die description keeps its flat layout for now.

Signed-off-by: Diljit Singh <[email protected]>
Without capacity-dmips-mhz every T6050 CPU reports a capacity of 1024,
so the scheduler treats the six P cores (apple,everest, CPUs 12-17)
like the twelve M cores and an unpinned single heavy thread lands on an
M core most of the time (4 of 5 runs on J714sAP).

Measured on J714sAP with every cluster pinned to 4284 MHz, which both
OPP tables have, and each core's clock read with a dependent-add chain:
per MHz an M core runs zstd -3 compression at 0.736, decompression at
0.871 and a Python dict loop at 0.728 of a P core (geometric mean
0.776). Small L1-resident integer, branch, sort, hash and FP loops run
at 0.92-1.01, which shows the execution units match but not how general
code runs. So M 794 and P 1024; with the 4380 and 4608 MHz tops the
M cores' capacity is 754. The values take effect through the cpu-map
the previous commit adds.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 10, 2026 00:54
@DjDeveloperr
DjDeveloperr merged commit 96b7bee into integration/aurora Nov 10, 2026
2 checks passed
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Merging: validated on the M5 Pro (J714sAP), CI green (dt-checks, host-tests).

Hardware evidence (2026-11-09). Run capb2 compared the default SSD boot, 7.3.0-m5-argb, with the same kernel plus only this PR's DTB, in one session:

  • Capacities: before, all 18 CPUs at 1024 with no clusters. After, CPUs 0-11 at 754 and 12-17 at 1024, clusters 0-5 / 6-11 / 12-17. A first test of the capacities without the cpu-map (capb1) stayed at 1024, because parse_dt_topology() reads capacity-dmips-mhz only through cpu-map.
  • Placement: an unpinned single-thread hog ran on CPUs 12-17 in 5 of 5 runs, against 1 of 5 before.
  • gpubench spread, unpinned, 6 runs per test: submit.empty 9.3 % -> 0.6 %, render.light 36.8 % -> 5.7 %. The GPU-bound bandwidth test is unchanged (0.1-0.2 %). compute.light stays at about 24 %: it is multi-threaded and noisy even when pinned. Pinned to CPUs 12-17, spreads stay small (0.4-3.1 % on the steady tests).
  • Health: no oops/BUG/WARN/SError, Hyprland up, rolled back to argb afterwards.
  • The value: per-MHz single-thread throughput with every cluster at 4284 MHz gave M/P = 0.736 on zstd compression, 0.871 on decompression and 0.728 on a Python loop (geometric mean 0.776), so M 794 and P 1024.
  • All 11 T6050 board DTBs build.

🤖 Generated with Claude Code

@RyanTheTide
RyanTheTide deleted the djdev/t6050-cpu-capacity branch November 16, 2026 05:04
funkzy added a commit to funkzy/linux that referenced this pull request Nov 18, 2026
…2s, for up to 1.5x faster and steadier light GPU submits on M5 Ultra

The M5 Ultra's CPU nodes have no cpu-map and name no cache, so Linux
sees thirty CPUs in one package with no clusters, and one L2 shared by
all thirty. Two things follow on the J775D (Mac Studio):

- parse_dt_topology() reads capacity-dmips-mhz only while it walks
  cpu-map, so the M and P core capacities that t6050-base.dtsi gives
  every T6050 CPU (dj's aurora-silicon#1399) never reach the scheduler: every CPU
  reports cpu_capacity 1024.
- With no last-level cache to group the CPUs by, the scheduler's
  cache-sharing domain is the whole package: a wakeup may pick any idle
  CPU of the thirty, on either die.

Describe the six clusters the way the one-die description does, commit
68c10dd ("arm64: dts: apple: t6050: Describe the CPU clusters"):
MPIDR Aff1 0, 1 and 2 are die 0's M0, M1 and P clusters and 0x10, 0x11
and 0x12 are die 1's, five cores each, as the ADT's cluster-id and
die-id give them. The clusters are listed flat, cluster0-2 on die 0 and
cluster3-5 on die 1, as the M1 and M2 Ultra descriptions (t6002.dtsi,
t6022.dtsi) list theirs; the topology parser does not support clusters
of clusters. The boot loader prunes the entries of cores it did not
start. The capacities in t6050-base.dtsi are kept as they are.

Add one L2 cache node per cluster and point each CPU's next-level-cache
at its cluster's: the ADT gives each CPU an l2-cache-size of 8 MiB in
the M clusters and 16 MiB in the P clusters. It gives no L1 sizes and no
L2 geometry, so the nodes carry the level and the size only. They sit in
/cpus as l2-cache-N, as in t6002.dtsi and t6022.dtsi.

Both are in one commit because the gain needs both. With the cpu-map
alone the clusters and capacities appear, but every CPU still reports
its L2 as shared by all thirty, and the rows below read as without it
(18.4-23.0 us at depth 8, on integration's head of 2026-11-10).

Only t6050-j775d.dts includes t6050-ultra.dtsi, so the J775D is the only
board whose device tree changes: the ten other T6050 board device trees
(J714c, J714s, J716c, J716s, J775c, J873s, K114c, K114s, K116c, K116s)
are byte-identical with and without the series. The one-die description
(t6050-max.dtsi) has a cpu-map and no cache nodes; this commit leaves
it unchanged.

Testing, on J775D, integration/aurora's head of 2026-11-14 (the merge
of aurora-silicon#1901) with the J775D GPU described (its own pull request), two boots
with and two without this commit, three passes of each row a boot:
- cpu_capacity reads 754 on the twenty M cores and 1024 on the ten P
  cores (1024 on all thirty without); cluster_cpus_list reads six lists
  of five (thirty lists of one without); each CPU's L2 reads 8 MiB or 16
  MiB shared by its own five (no size, shared by all thirty, without).
- A light compute submit with 8 in flight takes 16.8-17.6 us against
  20.1-23.5, and with 64 in flight 13.7-14.5 us against 16.1-24.0. A
  720p fill with 4 in flight takes 43.3-45.4 us against 50.5-70.3. By
  the median of the six passes these are 1.31x, 1.52x and 1.40x. A
  single-triangle render with 8 in flight takes 31.9-32.5 us against
  30.9-37.6, and with 32 in flight 29.1-29.9 us against 28.2-38.0:
  steadier rather than faster. Single submits and the heavy compute rows
  are unchanged, and a semaphore hop between two queues takes 42.3-46.5
  us against 45.0-49.1.
- The GPU's compute and chained-submit checks, 46 concurrent clients and
  a 628-case render CTS subset (571 pass, 57 not supported) read the
  same either way, with no GPU recovery, fault or timeout in the kernel
  log.

Signed-off-by: Jeff Queisser <[email protected]>
funkzy added a commit to funkzy/linux that referenced this pull request Nov 21, 2026
…eduler gets the M5 Ultra's M and P core capacities (754 and 1024, not 1024 on all thirty)

The M5 Ultra's CPU nodes have no cpu-map, so Linux sees thirty CPUs in
one package with no clusters. parse_dt_topology() reads
capacity-dmips-mhz only while it walks cpu-map, so the M and P core
capacities that t6050-base.dtsi gives every T6050 CPU (dj's aurora-silicon#1399) never
reach the scheduler: on the J775D (Mac Studio) every CPU reports
cpu_capacity 1024, and cluster_cpus_list reads thirty clusters of one.

Describe the six clusters the way the one-die description does, commit
68c10dd ("arm64: dts: apple: t6050: Describe the CPU clusters"):
MPIDR Aff1 0, 1 and 2 are die 0's M0, M1 and P clusters and 0x10, 0x11
and 0x12 are die 1's, five cores each, as the ADT's cluster-id and
die-id give them. The clusters are listed flat, cluster0-2 on die 0 and
cluster3-5 on die 1, as the M1 and M2 Ultra descriptions (t6002.dtsi,
t6022.dtsi) list theirs; the topology parser does not support clusters
of clusters. The boot loader prunes the entries of cores it did not
start. The capacities in t6050-base.dtsi are kept as they are.

The caches are described already: dj's commit 1bd5f40 ("arm64:
dts: apple: t6050: Describe the CPU caches") gives each cluster its L2
and points each CPU's next-level-cache at it, and each cluster here is
the set of CPUs that share one of those L2s.

Only t6050-j775d.dts includes t6050-ultra.dtsi, so the J775D is the only
board whose device tree changes: the ten other T6050 board device trees
(J714c, J714s, J716c, J716s, J775c, J873s, K114c, K114s, K116c, K116s)
are byte-identical with and without the series. The one-die description
(t6050-max.dtsi) has its cpu-map already; this commit leaves it
unchanged.

Testing, on J775D, integration/aurora's head of 2026-11-21 (a84637d,
the merge of aurora-silicon#2654), one boot with and one without the series, both
with a local display fix that is not part of it: cpu_capacity reads 754
on the twenty M cores and 1024 on the ten P cores (1024 on all thirty
without), and cluster_cpus_list reads six lists of five (thirty lists of
one without). Each CPU's L2 reads the same either way: 8 MiB or 16 MiB,
shared by its own cluster's five.

Signed-off-by: Jeff Queisser <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant