Skip to content

arm64: dts: apple: t6031: add measured CPU energy model - #3854

Merged
RyanTheTide merged 1 commit into
mainfrom
dts/t6031-cpu-energy-model
Dec 2, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
dts/t6031-cpu-energy-model

Conversation

@maralcbr

@maralcbr maralcbr commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Summary

t6031-base.dtsi (inherited by T6031 16-core M3 Max, T6034 14-core M3 Max, and T6032 M3 Ultra die 0) carries no opp-microwatt on its CPU OPP tables, leaving /sys/kernel/debug/energy_model empty, energy-aware scheduling disabled, and power_allocator without CPU power actors.

Add hardware-measured per-CPU opp-microwatt curves for all 6 Sawtooth E-core OPPs (1020–2568 MHz) and all 20 Everest P-core OPPs (1092–4056 MHz), measured on a live 16-inch M3 Max (J516C, T6031) via SMC cluster power keys:

  • E-cluster (sawtooth_opp, 4 cores, PPMC delta / 4): fitted across uncapped 1020–2484 MHz (ln(P/mW) = 4.733 + 1.244 ln f + 0.710 (ln f)^2, RMS 4.9 mW), extrapolated to hardware-capped 2568 MHz (116–691 mW/core).
  • P-cluster (everest_opp, 6 cores, PC02+PC03 delta / 6, cross-checked against P1 PC42+PC43 within 1–3%): fitted across 2172–3420 MHz (above the PC03 rail floor and below the ~25.5 W PMP all-core cap, constrained to b >= 1, ln(P/mW) = 6.029 + 1.020 ln f + 0.690 (ln f)^2, RMS 40.2 mW; 41.0 mW across all 12 uncapped states 1092–3420 MHz), extrapolated to 3516–4056 MHz (457–6695 mW/core).
  • Strict Linux Energy Model cost monotonicity: verified in exact kernel microwatt integer math (power * 10 / performance, cpu_capacity 550 / 1024): E costs rise strictly 5,321 → 12,563, P costs rise strictly 16,618 → 65,380 (zero inefficient OPPs, and every E OPP strictly cheaper than the lowest P OPP).

Tested: MacBook Pro 16-inch (M3 Max, J516C, T6031) at 33f85f4 (live SMC power sweep across all 6 E-cluster OPPs, all 20 P0-cluster OPPs, P0 1-core top OPPs, and P1 6-core spot checks; ARM64 kernel + DTB build b1202-103918-3651 and all 5 board DTBs t6031-j514c, t6031-j516c, t6034-j514m, t6034-j516m, t6032-j575d compile with zero new warnings; checkpatch --strict clean; Codex review VERIFIED 01a23427-73a4-75d1-b4e9-39a20be8b9c5).
Risk: two-way · T6031/T6034/T6032 die-0 CPU Energy Model (opp-microwatt in t6031-base.dtsi)

T6031's CPU OPP tables in t6031-base.dtsi (inherited by T6031 M3 Max,
T6034 14-core M3 Max, and T6032 M3 Ultra die 0) carry no opp-microwatt,
so no CPU energy model registers (/sys/kernel/debug/energy_model is
empty), energy-aware scheduling stays disabled, and power_allocator has
no CPU power actors.

Add per-CPU opp-microwatt for all six Sawtooth E-core OPPs and all
twenty Everest P-core OPPs, measured on a live J516C (16-inch, 16-core
M3 Max) via SMC cluster power keys: PPMC for the 4-core E cluster
(1020-2484 MHz, rms 4.9 mW; 2568 MHz hardware-capped at 2484 MHz power
and extrapolated) and PC02+PC03 for the 6-core P0 cluster (2172-3420 MHz
above the PC03 rail sensor floor and below the ~25.5 W PMP cluster cap,
rms 40.2 mW; cross-checked against P1 PC42+PC43 within 1-3%; 3516-4056
MHz extrapolated).

Both curves are strictly monotonic in power and in Linux's microwatt
Energy Model integer cost (power * 10 / performance at cpu_capacity 550
and 1024), so no lower OPP is marked inefficient and every E-core OPP
remains strictly cheaper per unit performance than the lowest P-core OPP.

Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
@maralcbr
maralcbr requested review from a team as code owners December 2, 2026 00:46
@maralcbr
maralcbr requested review from LiamRay11 and malik-na and a balanced review from Copilot December 2, 2026 00:46
@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at 33f85f4d: ready to merge

Check Detail
CI at head ok 5 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at 33f85f4d
Conflicts ok none
PR text ok Risk: two-way · T6031/T6034/T6032 die-0 CPU Energy Model (opp-microwatt in t6031-base.dtsi)

Areas: area:platform
Merge: gh pr merge 3854 --merge (Owners and Core through the bypass: add --admin).

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Hardware-maintainer validation is needed for the extrapolated high-frequency power estimates because raw measurements and post-change scheduling and thermal runtime results are unavailable.

No open issues 🎉

What changed in this PR

Adds CPU power estimates to the shared T6031 device tree to support Linux Energy Model consumers on T6031, T6034, and T6032 die 0.

Changes:

  • Adds opp-microwatt values for all 6 efficiency-core and 20 performance-core operating points.
  • Documents hardware measurements, curve fitting, and extrapolation for capped states.
File Description
arch/​arm64/​boot/​dts/​apple/​t6031-base.dtsi Adds per-CPU power curves and documents their measurement methodology.

Review effort: Balanced

@maralcbr

maralcbr commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Hardware measurement note:

  • All 6 E-cluster OPPs (1020..2568 MHz, PPMC) and all 20 P-cluster OPPs (1092..4056 MHz, PC02+PC03 cross-checked against P1 PC42+PC43, plus 1-core uncapped measurements above the all-core PMP power cap at 3516..4056 MHz) were measured directly on a 16-inch M3 Max (j516c, 16 CPU / 40 GPU).
  • Note that one-shot lab run boots on Tier-1 Volunteer Macs intentionally preserve /boot/efi/m1n1/boot.bin, so live /sys/kernel/debug/energy_model activation with the rebuilt t6031-j516c.dtb will be exercised once packaged via update-m1n1 on edge.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 33f85f4. The values follow the fitted curves, rise strictly per state, and every E state costs less than the lowest P state, so the Energy Model registers with no inefficient OPPs. T6032 die 1 has no opp-microwatt, so EAS stays off on M3 Ultra (perf domains without an EM disable it) while die 0 gets power actors; that is harmless.

Merge needs a boot of this DTB at this head on a T6031 Mac, since the comment on the PR says the lab runs kept the old boot.bin: /sys/kernel/debug/energy_model populated for both clusters, sched_energy_aware on, a short idle and load check with no new kernel warnings.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merge status: one item left, a T6031 boot with this DTB.

The change is approved, and its merge into current main passes the device-tree checks (below). The power sweep backs the values, but no boot has used the new DTB yet (the lab runs kept the old boot.bin).

To close it, please boot an M3 Max (the J516C is fine) with a DTB built from this PR, installed with update-m1n1, and post one line naming the head SHA, the Mac and the result:

  • /sys/kernel/debug/energy_model lists both CPU clusters with the new power values;
  • /proc/sys/kernel/sched_energy_aware is 1;
  • a short idle and load check with no new kernel warnings.

One boot of a DTB that carries this PR, #3855 and #3856 unchanged counts for all three.

Local checks on the merge result (hosted CI stand-in)
  • Head 33f85f4d05e2 merged into main 5a870d0f0b3f (merge tree dde726f46c0d); arm64, LLVM=1, dtschema 2026.9.
  • scripts/dtc/apple-dt-check.sh: all 141 Apple DTBs build at base and merge. Five change: t6031-j514c, t6031-j516c, t6032-j575d, t6034-j514m, t6034-j516m. CHECK_DTBS on them: 75 warning lines at both, 0 new, 0 removed. dtc warnings: 0 at both. No T6030 DTB changes.
  • ADT coverage and DART power-domain checks: pass, nothing new.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at 33f85f4d05e2 (B2 merge train, 12-01 merge bar). Approval at this head: DjDeveloperr. Row: in the PR body at 33f85f4. CI: linux train L24 (candidate fdfedd05e955 on main a76093e): Apple driver build pass + touched objs pass (kernel/sched/psi.o verified with CONFIG_PSI=y) + DTBs pass + 12/12 relevant KUnit suites pass (ane-boot 333, clpc 22, ane-pm 20, dcp-fabric 117, dcp-topology 235/236, dcp-display 220/221, ave 57, apple-dart 40, jpeg 15, isp 61, mt7932 98/99, asahi 567/571; avd-pm-test.c pre-existing Clang 22 warning on main) + host tests pass (apple-dcp 1/1, dcp 96/96, g17 329/329). Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit 345ddee into main Dec 2, 2026
8 checks passed
@RyanTheTide
RyanTheTide deleted the dts/t6031-cpu-energy-model branch December 2, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:platform Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants