Skip to content

J616s: put the CPU thermal backstop above the PMP's operating point (aurora-wip) - #606

Closed
RyanTheTide wants to merge 2 commits into
aurora-wipfrom
thermal/j616s-wip-20261030
Closed

RyanTheTide wants to merge 2 commits into
aurora-wipfrom
thermal/j616s-wip-20261030

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

On the M4 Pro MacBook Pro 16 (J616s) the CPU thermal zones' passive trips can't throttle anything today, and they sit below the point where the firmware already holds the die. This PR moves the trips and adds the measured energy model that lets them act.

What a guarded load test showed (fleet9, 2026-10-30)

A 90 s all-core busy loop (14 pinned spinners, stopped automatically at 116 C) gave these results:

  • TCMz reached 113.4 C after 19 s, then held between 113.4 and 114.7 C until the load stopped.
  • The PMP's fast die-temperature effort limit did the regulating. The P clusters' cpufreq maximum stepped between 2868 and 4512 MHz. The E cluster stayed at 2592 MHz.
  • The SMC fans ramped by themselves, from 0 to about 3450/3730 rpm.
  • All three cpufreq cooling devices stayed at state 0 the whole time, even with every CPU zone above its 113 C passive trip.

The ADT's fast-die-ctrl-loop puts the PMP loop's target at 110.0 C on its own hot-spot sensors. Its temp-sensor entries list 110 and 125 C per sensor. The SMC die maxima read a few degrees above the PMP's sensors.

Why the zones don't act

power_allocator is the default governor. It only drives power actors, and T6040's CPU OPPs carry no opp-microwatt, so no energy model registers. /sys/kernel/debug/energy_model is empty, and with no actors the governor returns without throttling. Every other Apple SoC DT in the tree (T8103, T8112, T600x, T602x, T8140) has OPP power values. The critical trip (orderly shutdown at 118 C) does work, because it doesn't depend on the governor.

This change

  • All 17 CPU zones get their passive trip at 116 C, above the measured settling band and below the 118 C critical trip. Once the zones can throttle, a 113 C trip would fight the firmware loop in normal use.
  • The comment that said TCMz settles near 111 C is corrected.

The trip move alone changes nothing at runtime. With the energy model commit, the CPUs become power actors and the zones can throttle.

Pending, not in this PR

  • T6040 energy model: now added (second commit). opp-microwatt for the E, P0 and P1 tables, measured on the J616s from the SMC core rails (method and raw data in the PR comment). With an EM, the seven GPU zones' 101 C CPU shedding also becomes active for the first time. That needs a GPU+CPU benchmark before merge.
  • Live DT. The J616s boots the DT embedded in its Stage 2. The live tree on fleet9 has neither PR 560's fan trips nor this change, so both need a Stage 2 rebuild.

Evidence (load log, scripts, ADT decode) is in the aurora-ctl reports directory j616s-thermal-backstop-20261030. dtc builds the J616s DTB on both bases.

🤖 Generated with Claude Code

RyanTheTide and others added 2 commits October 30, 2026 13:35
…operating point

The CPU zones' passive trip sat at 113 C on the assumption that the
PMP's fast die-temperature loop settles TCMz near 111 C. It does not.
The loop holds the PMP's own hot-spot sensors at 110.0 C (the target in
the ADT's fast-die-ctrl-loop), and the SMC's die maxima read a few
degrees above that. A 90 s all-core busy loop on the J616s with both
fans running took TCMz to 113.4 C after 19 s and held it between 113.4
and 114.7 C, the P clusters trimmed by the PMP's effort limit (their
cpufreq maximum stepping between 2868 and 4512 MHz) and the E cluster
untouched at 2592 MHz.

A backstop at 113 C would therefore act in normal use and fight the
firmware loop as soon as the zones can throttle. Move it to 116 C on
all seventeen CPU zones, above the measured settling band and below the
118 C critical trip, and correct the comment.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
T6040's CPU OPP tables carry no opp-microwatt, so no energy model
registers and power_allocator has no power actors. The CPU thermal
zones then never throttle anything.

Add per-core power for the E, P0 and P1 tables, measured on a J616s
running at each state with the cluster pinned and read from the SMC
core-rail meters: PR0b for P0, PP0b for P1 and PP2b for E. The meters
were identified by busying one core of each cluster at its lowest and
highest state and checking which power and voltage keys follow.

One busy P core gives clean readings up to 4104 MHz. At 4416 and
4512 MHz the PMP's die-temperature limit pulls the core back to
4044 MHz within two seconds, so the P values come from a
k * V^2 * f + c fit to the clean points (rms 0.2 W), using the rail
voltage measured at each state. This also keeps the tables monotonic
where the 4 s samples are noisy.

One busy E core does not register on PP2b below 2352 MHz. As on T8140,
the E values are the idle cluster at that state plus a quarter of the
increase with all four E cores busy.

Assisted-by: LLM
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Added the T6040 energy model (opp-microwatt for E, P0 and P1), measured on the J616s on fleet9 this afternoon. Commit d604580 on this branch, c393c56 on the integration/aurora twin (#605).

Rails. railid.sh busied one core per cluster at its lowest and highest state. The keys that follow it are PR0b/VR0b (P0), PP0b/VP0b (P1) and PP2b/VP2b (E); the voltage keys step with the P-state. PPSC and PPMC look like aggregates that also include the SRAM side, so they were not used, matching T8140, which uses the core rails.

Method. One pinned busy core per state, 4 s average after 1.2 s settle, start below 52 C, guard at 110 C, each run under 90 s, scaling limits restored on exit. P clusters were swept in two halves.

  • P: clean up to 4104 MHz. At 4416 and 4512 MHz the die goes from 48 to 76 C within about 3 s and the PMP limit pulls the core to 4044 MHz (cpuinfo_cur_freq), so those two states can't be read directly. The values use a k * V^2 * f + c fit to the 17 clean points, with V the rail voltage measured with the cluster pinned at that state. P0 has k 1.458 W/(V^2 GHz), c -0.124 W and rms 0.196 W. P1 has k 1.396, c -0.106 and rms 0.194. The fit also keeps the table monotonic where the raw points are noisy (raw P0 3996 is below 3924, for example).
  • E: one busy E core doesn't register on PP2b below 2352 MHz (it reads 5 to 11 mW at idle and at one busy core alike). As on T8140, I used idle cluster plus a quarter of the four-core increase.
MHz E uW P0 uW (raw) P1 uW (raw)
1020 81900
1260 513000 (605788) 561800 (619422)
1404 133100
1512 715000 (743396) 772500 (821169)
1788 209400
1800 907500 (981295) 988900 (1057457)
2088 1158200 (1154756) 1302300 (1294413)
2112 301400
2352 383900 1494500 (1404997) 1644100 (1481240)
2532 478500
2592 531000
2616 1782600 (1800360) 2003700 (2008240)
2868 2209600 (2153497) 2349000 (2380170)
3096 2636700 (2498971) 2723000 (2426187)
3300 3247200 (2879817) 3333200 (3190893)
3468 3668700 (3666471) 3711900 (2947829)
3624 4128200 (4055831) 4129900 (3971953)
3756 4819300 (4911848) 4666300 (4680465)
3852 4977700 (4901246) 4881000 (4760551)
3924 5315900 (5534947) 5176700 (5118546)
3996 5575900 (4858967) 5306500 (5272011)
4044 5773400 (5954711) 5618900 (5871900)
4104 5969200 (6229571) 5843100 (5525284)
4416 8274900 (6573012, clipped to 4044) 8075300 (6769722, clipped to 4044)
4512 9256900 (7021514, clipped to 4044) 8949200 (6636618, clipped to 4044)

E detail (uW, idle / one busy core / four busy cores): 1020: 8170 / 8125 / 302978, 1788: 4985 / 9473 / 822455, 2352: 11754 / 419816 / 1500196, 2592: 16765 / 464015 / 2073718. At 2352 and above, the single-core reading (420 to 483 mW) agrees with the derived per-core value (384 to 531 mW).

dtc builds t6040-j616s.dts on both branches with the same two warnings as before. Not runtime-tested: the J616s boots the DT in its Stage 2, so the EM only goes live with a Stage 2 rebuild. Before merge it still needs a check that /sys/kernel/debug/energy_model shows three perf domains, plus the CPU+GPU load run noted above.

Raw data and scripts are in the aurora-ctl reports directory j616s-thermal-backstop-20261030: railid.txt, em2-e.tsv, em2-p.tsv, em2-ptop.tsv, em-e-busy.tsv, em-p0-busy.tsv, em-p1-busy.tsv, em-fit.txt, emsweep2.sh.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded by #715, merged into aurora-wip with house trailers.

@RyanTheTide
RyanTheTide deleted the thermal/j616s-wip-20261030 branch October 31, 2026 14:07
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