Skip to content

thermal: apple-pmp: 200 ms cool slow poll on #3949 + #3766 - #3994

Closed
IronsideXXVI wants to merge 11 commits into
aurora-silicon:mainfrom
IronsideXXVI:j604/apple-pmp-cool-poll-dark-hold
Closed

IronsideXXVI wants to merge 11 commits into
aurora-silicon:mainfrom
IronsideXXVI:j604/apple-pmp-cool-poll-dark-hold

Conversation

@IronsideXXVI

@IronsideXXVI IronsideXXVI commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

What: Add a cool-only 200 ms slow poll cadence (< 90 C) to apple-pmp-thermal on Apple T8132, landed cleanly on top of #3949 (single-hop delayed_work poll_work) and #3766 (52e3af5dd8ac, 250 mW GPU-busy dark-hold gate on top of main's 15 s cap):

  1. Cool-only 200 ms slow poll (< 90 C): Add apple_pmp_poll_interval_ms() in include/linux/soc/apple/pmp-cooling.h and slow_poll_ms in drivers/thermal/apple-pmp-thermal.c so settled cool polling (< 90 C, !fast_poll) runs at 200 ms (50 jiffies at HZ=250, Level-0 timer wheel, <= 204 ms, strictly inside apple_pmp_cooling_sample()'s 50-250 ms slope window), while keeping 100 ms in 90..94.9 C for tighter ramp tracking approaching 95 C and 5 ms hrtimer polling at >= 95 C or during error, cooling, or recovery.
  2. Immediate 100 ms entry on 90..94.9 C: Built on #3949's single-hop delayed_work poll_work so apple_pmp_poll_reschedule() reads slow_poll_ms after apple_pmp_sample() updates it. Entering 90..94.9 C from a cool 200 ms poll schedules the very next poll at 100 ms (never a stale 200 ms). probe(), setup(), change_mode(), and prepare() initialize slow_poll_ms conservatively to 100 ms.
  3. Preserves #3766 / main's 15 s dark hold and 250 mW GPU gate: Drops the earlier unmeasured 30 s dark-hold cap expansion and 50 mW rail_ns/debounce path; inherits #3766 @ 52e3af5dd8ac's apple_pmp_die_idle() and apple_pmp_gated_hold_sample() verbatim so post-wake dark reads hold identically to main and #3766.
  4. Tests: Extends apple-pmp-policy KUnit (17/17, adding apple_pmp_test_cool_poll_interval and apple_pmp_test_cool_dark_idle_rate: 0 errors and 3000 polls across 10 idle minutes + post-wake dark-read replay) and tools/asahi/pmp-thermal-poll-tests.py (all #3949 single-hop invariants, #3766 dark_sensor_tests(), 92 C immediate 100 ms entry test, and 4/4 mutation checks).

Tested:

  • Offline at exact head c36b5a0d3 (clean forward merges of #3949 @ 564e67a67c6b and #3766 @ 52e3af5dd8ac into j604/apple-pmp-cool-poll-dark-hold, 0 merge-tree conflicts against origin/main):
    • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks (905 lines checked).
    • Clang 18.1.8 ARM64 LLVM=1 W=1 KCFLAGS="-Werror":
      • drivers/thermal/apple-pmp-thermal.o (343168 bytes): 0 warnings, 0 errors.
      • drivers/thermal/apple-pmp-policy-test.o (274792 bytes): 0 warnings, 0 errors.
    • ARM64 QEMU KUnit apple-pmp-policy (KASAN+UBSAN): 17/17 PASSED (0 failed).
    • Host poll & mutation tests (python3 tools/asahi/pmp-thermal-poll-tests.py, -Wall -Wextra -Werror -fsanitize=undefined): PASS + 4/4 mutations caught (7.5 s cap, failed rail read counts as GPU work, GPU work does not end hold, warm band stays at 200 ms).
  • Earlier live Apple M4 MacBook Pro 14" (J604, T8132) hardware validation on integrated linux-aurora 7.3.0.aurora1-1.1687 (carrying 200 ms cool polling alongside sched/topology, 0 kernel faults):
    • 619 s idle PMP gate: pmp_sc wakeup rate halved 9.61 -> 4.89/s, PMPEV events=0 supp=0 serr=0, idle die 33.8 C, deep-sleep wake rc=0.
    • Detached idle wakeups (n=10): median 114.58 -> 112.44/s (pmp_sc 4.90/s across 11/12 windows); PHPC idle 730.5 -> 681.5 mW (-49.0 mW), PMVR 2071.0 -> 1979.9 mW (-91.1 mW).

Risk: two-way door · M4 (T8132) apple-pmp-thermal. Stacked cleanly on #3949 + #3766 @ 52e3af5dd8ac (5 files total relative to main; #3994's own delta over #3949 + #3766 is only apple_pmp_poll_interval_ms() + slow_poll_ms + tests). Preserves 5 ms fast hrtimer polling at >= 95 C / cooling / fault, immediate 100 ms polling on entry to 90..94.9 C, 15 s cool idle hold, 2 s busy / active-GPU (>= 250 mW) hold, and post-wake hold behavior; a plain revert restores 100 ms cool polling.

Not yet:

  • Merge order: #3949, then #3766, then #3994 (both merged forward here so the branch builds and tests cleanly as a delta).
  • Exact-head (c36b5a0d3) bare-metal hardware rows: J604, J773g (30 min idle desktop with PP1b logged and 0 sensor errors, idle->all-core and idle->GPU ramps vs base, GPU load while CPUs dark, 3 s2idle + 3 deep-sleep cycles), and fanless T8132 (J713/J715) ramps.
  • Any > 15 s dark-hold extension is deferred to a separate PR once ANE-only and ProRes-only die ramp rates are measured on fan and fanless T8132.
Details and verification

Scope (j604/apple-pmp-cool-poll-dark-hold, head c36b5a0d3)

  • Forward-merged #3949 (564e67a67c6b, commit 1e1c8e8f3) and #3766 (52e3af5dd8ac, commit c36b5a0d3), zero force-push.
  • drivers/thermal/apple-pmp-hold.h: identical to #3766 @ 52e3af5dd8ac.
  • include/linux/soc/apple/pmp-cooling.h: adds APPLE_PMP_POLL_MS (5U), APPLE_PMP_SLOW_POLL_MS (100U), APPLE_PMP_COOL_POLL_MS (200U), APPLE_PMP_COOL_POLL_MC (90000), and apple_pmp_poll_interval_ms().
  • drivers/thermal/apple-pmp-thermal.c: sets slow_poll_ms from apple_pmp_poll_interval_ms() in apple_pmp_sample() and reads it in #3949's apple_pmp_poll_reschedule(), resetting to 100 ms in probe(), setup(), change_mode(), and prepare().
  • drivers/thermal/apple-pmp-policy-test.c: 17/17 KUnit (KASAN+UBSAN ARM64 QEMU PASS).
  • tools/asahi/pmp-thermal-poll-tests.py: PASS + 4/4 mutations caught.
  • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks (905 lines checked).
  • Clang 18.1.8 ARM64 LLVM=1 W=1 KCFLAGS="-Werror": apple-pmp-thermal.o (343168 B) and apple-pmp-policy-test.o (274792 B), 0 warnings, 0 errors.

…he GPU is idle

The PMP firmware publishes a die record only while its CPU cluster has
power. When every record is dark (`-ENODATA`), the driver reuses the last
reading for a fixed 2 s (`APPLE_PMP_GATED_HOLD_NS`). On J604 (T8132), with
cool polling slowed to 50-100 ms, an idle desktop routinely stays dark
past 2 s, expiring the hold, logging repeated sensor errors, and clamping
both CPU clusters at their floor while polling recovers.

For a cool last reading (`< APPLE_PMP_GATED_HOLD_MC`), extend the dark
hold past 2 s at 8 C/s of headroom below `APPLE_PMP_PASSIVE_MC` (clamped
to [2 s, 10 s]: 8.25 s at 40 C, 6.5 s at 54 C, 2 s at >= 90 C), gated on
the GPU rail (`PP1b`, sampled by the power worker every 500 ms) reading
idle (`< 50 mW`, no error, timestamp <= 1 s old). Because every die record
is a CPU record, the GPU rail gate prevents a busy GPU from heating the
die unseen while CPU clusters are power-gated. Clear `rail_ns` on probe
and across sleep (`apple_pmp_thermal_complete`) since `CLOCK_MONOTONIC`
pauses during sleep.

Non-`-ENODATA` errors, hot readings (`>= APPLE_PMP_GATED_HOLD_MC`),
missing/stale/errored rail reads, GPU load (`>= 50 mW`), and dark spells
past the scaled cap (10 s maximum) continue to take the stock fail-closed
path immediately.

Add KUnit coverage in `apple_pmp_test_dark_hold_gate`.

Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
Integrate the dark-sensor hold with upstream main's apple-pmp-hold.h
gated-hold helper, CPU idle tracker, sleep/resume real-sample-age
tracking, and thermal-zone fault-disable handling:

- Gate extended dark holds in apple_pmp_sample() on both cpus_idle and
  apple_pmp_gated_gpu_idle() (PP1b < 50 mW, error-free, <= 1 s fresh,
  with rail_ns cleared on probe, cleanup, and across sleep).
- Bound apple_pmp_gated_hold_sample() by apple_pmp_gated_hold_ns(valid_mc)
  (8 C/s headroom below APPLE_PMP_PASSIVE_MC, clamped to [2 s, 10 s])
  instead of a flat 15 s cap.
- Update apple_pmp_test_gated_hold() and tools/asahi/pmp-thermal-poll-tests.py
  for the headroom-scaled cap and rail_ns sleep-resume reset.

Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
…P1b debounce

On quiet idle Apple T8132 desktops, two idle-efficiency issues remain in
apple-pmp-thermal:

1. Cool idle dark spells with both CPU clusters power-gated and the GPU
   idle can cross the 15 s hold ceiling or observe a single transient
   compositor PP1b >= 50 mW sample, collapsing the hold to 2 s and
   triggering a -ENODATA sensor error with a 1.8 s 5 ms fast-poll
   recovery storm.
2. Cool polling (< 90 C) wakes every 100 ms even though
   apple_pmp_cooling_sample() accepts slope intervals up to 250 ms and
   Level-0 timer wheel slack at HZ=250 keeps 200 ms polling strictly
   within 204 ms.

Make three bounded adjustments while keeping all hot/load fail-closed
guards intact:
- Add headroom-scaled GPU-gated dark holds via apple_pmp_gated_hold_ns()
  and apple_pmp_gated_hold_sample_capped(): a 2 C/s budget below 75 C
  capped at 30 s (<= 46 C) while CPU clusters and the GPU rail are idle,
  a 4 C/s budget at 75..90 C (7.75 s at 75 C, 5.25 s at 85 C), and
  immediate 2 s fail-closed at >= 90 C or on CPU/GPU load.
- Track rail_ns on successful SMC power polls (cleared across sleep,
  cleanup, and probe) and add apple_pmp_gpu_gate_idle() to require two
  consecutive fresh PP1b >= 50 mW samples before collapsing an active
  cool (< 75 C) dark hold back to 2 s, failing closed immediately on
  warm dies (>= 75 C), sustained GPU load, non-dark reads, or
  missing/stale/errored SMC reads.
- Add apple_pmp_poll_interval_ms() to poll at 200 ms below 90 C when not
  in fast poll, keeping 100 ms at 90..94.9 C (preserving the 100 ms
  transient SRAM glitch hold) and 5 ms at >= 95 C or during fault,
  cooling, or recovery.

Extend apple-pmp-policy KUnit tests and pmp-thermal-poll-tests.py to
cover 200 ms vs 100 ms vs 5 ms poll cadence, headroom-scaled 30 s cool
holds, and 1-sample PP1b debounce vs 2-sample fail-closed.

Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
@IronsideXXVI
IronsideXXVI requested review from a team and DjDeveloperr as code owners December 2, 2026 20:40
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m4 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 f4188ec0: not ready yet

Check Detail
CI at head ok 9 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by DjDeveloperr
Hardware row at head ok comment at f4188ec0
Conflicts ok none
PR text ok Risk: two-way · M4 (T8132) apple-pmp-thermal. Stacked cleanly on #3949 + #3766 @ 52e3af5dd8ac (5 files total relative to main; #3994's own delta over #3949 + #3766 is only applepmppollintervalms() + slowpollms + tests). Preserves 5 ms fast hrtimer polling at >= 95 C / cooling / fault, immediate 100 ms polling on entry to 90..94.9 C, 15 s cool idle hold, 2 s busy / active-GPU (>= 250 mW) hold, and post-wake hold behavior; a plain revert restores 100 ms cool polling.

Areas: area:gpu

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

@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.

Review at ca69b4b55906. The GPU gate is an improvement on main, which holds a dark die for 15 s whatever the GPU does. At 75 C and above every hold is shorter than main's, and 95 C, faults and cooling still poll at 5 ms. Two paths are looser than the text says, and it overlaps two open PRs, so please take another round.

Must change

  1. The 90-95 C band gets the 200 ms poll on entry. apple_pmp_slow_poll_work() queues the sample and re-arms with the old slow_poll_ms before that sample runs. I added that case to your poll harness: after a 92 C sample the next poll is still 200 ms away. From 94.9 C that is 200 ms unseen where main has 100 ms. #3949 fixes the cause, because it re-arms after the sample, so this should land on top of it and read slow_poll_ms in apple_pmp_poll_reschedule().
  2. The first dark read after a wake now fails at once. With rail_ns cleared, the cap is 2 s from the last real read, not from the wake, so apple_pmp_gated_hold_resume() no longer does what its comment says. Replayed on the headers (40 C, 2 s dark, sleep, 1 s of suspend/resume time, dark read): main returns 0, #3766 returns 0, this returns -ENODATA, which caps the CPUs. Keep apple_pmp_gated_hold_ns(valid_mc) as the cap and let "GPU not idle" only start the 2 s clock, as #3766 does.
  3. The longer hold needs a basis. Below 75 C the hold goes from 15 s to as much as 30 s at "2 C/s"; #3766 uses 8 C/s and 10 s. Neither number is measured. ANE, ISP and ProRes can heat a die whose CPU clusters are gated and whose PP1b reads under 50 mW. Please post the fastest rise measured in that state (ANE-only and ProRes-only, fanless and fan) and derive the budget from it.

Order: #3949, then #3766 (approved, J773g row queued), then this as a delta on both. Right now it conflicts with #3766 in 4 files, and in pmp-cooling.h the two merge without a conflict but both define apple_pmp_gated_hold_ns(), so it wouldn't build. It conflicts with #3949 in 2 files. If you'd rather this replaces #3766, say so on #3766 now, before its rows run.

Also: a board whose idle PP1b stays at or above 50 mW (an external display, for example) drops from a 15 s hold to 2 s. The J773g row has to show that doesn't bring the sensor-error caps back. The "100 ms at 90-95 C protects the transient hold" reason doesn't apply: below 100 C the 2 s hold covers it, and from 95 C the poll is 5 ms.

Checked on main 2c667a4b + this head: apple-pmp-thermal.o and apple-pmp-policy-test.o W=1 clean, apple-pmp-policy KUnit 17/17 (UML), pmp host tests 24/24, thermal 1/1, checkpatch --strict clean. Hosted CI shows as skipped at this head.

Rows at the next head: J773g (T8132): 30 min idle desktop on its display with PP1b logged and 0 sensor errors; idle to all-core and idle to GPU ramps vs base (peak C, time to first 5 ms poll); GPU load while the CPUs are dark; ANE-only and ProRes-only load from cool; 3 s2idle and 3 deep-sleep cycles with 0 sensor errors after wake. A fanless T8132 (J713 or J715) for the same ramps. Your J604 at the head. Other SoCs don't bind this driver.

@github-actions github-actions Bot added the changes-requested A reviewer requested changes (bot) label Dec 2, 2026
DjDeveloperr and others added 3 commits December 2, 2026 20:25
Main already holds a cool dark die for up to 15 s while the CPUs are idle.
Scaling that cap down to 2-10 s by headroom, and requiring a fresh idle GPU
rail past 2 s, can only end a hold sooner. At 46 C the cap is 7.5 s, and
each expiry costs sensor errors, capped CPUs and 5 ms polling until the
sensors read again and the guard has stepped down. Over 10 idle minutes a
J773g went from 78 to 371 "sensor error -61" lines and from 304.6 to 330.6
arch_timer interrupts per second.

Go back to main's 15 s cap and keep the GPU gate, but let only a rail that
reads busy start the 2 s clock. A failed or missing rail read leaves main's
behaviour: the power policy already keeps the CPUs and the GPU at their
floor for it. That also removes the rail timestamp: a stale reading can't
hold the die longer than main does.

Set the GPU threshold between what a J773g reads idle (0-43 mW) and under
a light GPU load (1630 mW). 50 mW was within one 15 mW rail step of idle.

The KUnit and host tests check that 10 idle minutes of 14 s dark spells
cost no error and no fast poll. The host test also checks that mutations
(a 7.5 s cap, a failed rail read that counts as GPU work, no GPU gate) are
caught.

Signed-off-by: DjDeveloperr <hey@djdev.me>
…urora-silicon#3994

Land slow_poll_ms on top of aurora-silicon#3949's single-hop delayed_work poll_work so
apple_pmp_poll_reschedule() reads slow_poll_ms after apple_pmp_sample()
updates it. Entering the 90-95 C warm band now switches the very next
poll to 100 ms instead of waiting one stale 200 ms interval.

Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
…to cool 200 ms slow poll

Merge aurora-silicon#3766 (52e3af5, 250 mW GPU-busy dark-hold gate on top of
main's 15 s APPLE_PMP_GATED_IDLE_CAP_NS) cleanly so aurora-silicon#3994 is a minimal
delta on aurora-silicon#3949 + aurora-silicon#3766:

- Drop the unmeasured 15 s -> 30 s dark-hold cap expansion (deferring any
  > 15 s extension until ANE-only and ProRes-only die ramp measurements
  are collected on fan and fanless T8132).
- Drop the 50 mW rail_ns / apple_pmp_gpu_gate / apple_pmp_gated_hold_sample_capped()
  path, inheriting aurora-silicon#3766's apple_pmp_die_idle() (250 mW busy threshold,
  failed rail reads left on main's path) and apple_pmp_gated_hold_sample(),
  which also fixes the post-wake first dark read failure.
- Keep cool-only 200 ms slow polling (< 90 C, 100 ms in 90-94.9 C on
  immediate entry via aurora-silicon#3949's apple_pmp_poll_reschedule(), 5 ms at >= 95 C,
  cooling, or fault) and clean up the inaccurate transient-hold comment.
- Extend KUnit (17/17: cool poll cadence, 10-min 200 ms dark-idle rate =
  3000 polls / 0 errors, post-wake dark-read replay) and host poll tests
  (including 92 C warm-band immediate 100 ms entry + mutation test).

Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Dec 3, 2026
@IronsideXXVI IronsideXXVI changed the title thermal: apple-pmp: 200 ms cool poll, 30 s cool idle dark hold, and PP1b debounce thermal: apple-pmp: 200 ms cool slow poll on #3949 + #3766 Dec 3, 2026
@IronsideXXVI

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review, @DjDeveloperr. Addressed every point with two clean forward merges (1e1c8e8f3 and c36b5a0d3, no force-push) on top of #3949 (564e67a67c6b) and #3766 (52e3af5dd8ac):

  1. 90–95 C immediate 100 ms entry + #3949 ordering (1e1c8e8f3): Merged #3949 so apple_pmp_poll_reschedule() runs after apple_pmp_sample() updates slow_poll_ms. Added warm_band_entry_test() + a mutation check in tools/asahi/pmp-thermal-poll-tests.py confirming a 92 C sample from settled cool (200 ms) schedules the very next poll at 100 ms (and 95 C arms the 5 ms hrtimer). Also fixed the misleading "protects transient hold" comment in pmp-cooling.h, KUnit, and the PR text.
  2. Post-wake dark read + #3766 ordering (c36b5a0d3): Merged #3766 @ 52e3af5dd8ac and dropped the 50 mW rail_ns / gpu_gate / apple_pmp_gated_hold_sample_capped() path completely. #3994 now inherits #3766's apple_pmp_die_idle() (250 mW busy threshold, failed rail reads left on main's path) and apple_pmp_gated_hold_sample() verbatim (drivers/thermal/apple-pmp-hold.h has zero diff against #3766 @ 52e3af5dd8ac), so post-wake dark reads behave identically to main and #3766. Added the exact 40 C post-wake replay to KUnit (apple_pmp_test_cool_dark_idle_rate).
  3. Unmeasured 15 s -> 30 s hold extension dropped: Removed the 30 s cap expansion from #3994 so the idle cap stays at main / #3766's 15 s (APPLE_PMP_GATED_IDLE_CAP_NS). Any > 15 s extension is deferred to a separate PR once ANE-only and ProRes-only die ramp rates are measured on fan and fanless T8132. Updated the PR title and body accordingly.

Offline verification at c36b5a0d3

  • git merge-tree --write-tree origin/main HEAD: clean (0 conflicts).
  • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks (905 lines checked).
  • Clang 18.1.8 ARM64 LLVM=1 W=1 KCFLAGS="-Werror": drivers/thermal/apple-pmp-thermal.o (343168 B) and drivers/thermal/apple-pmp-policy-test.o (274792 B) — 0 warnings, 0 errors.
  • ARM64 QEMU KUnit apple-pmp-policy (KASAN+UBSAN): 17/17 PASSED (apple_pmp_test_cool_dark_idle_rate verifies 0 errors and 3000 polls over 10 idle minutes at 200 ms, plus the 40 C post-wake dark-read replay).
  • python3 tools/asahi/pmp-thermal-poll-tests.py (-Wall -Wextra -Werror -fsanitize=undefined): PASS + 4/4 mutations caught (7.5 s cap, failed rail read counts as GPU work, GPU work does not end hold, warm band stays at 200 ms).

The requested exact-head J604, J773g, and fanless T8132 hardware rows are tracked under Not yet once #3949 and #3766 land.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Dec 3, 2026
Use 10ULL, 14ULL, and 600ULL when multiplying by NSEC_PER_SEC in
apple_pmp_test_dark_idle_rate() so the multiplications do not overflow
32-bit signed long on 32-bit KUnit builds before converting to u64.

Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
…e_rate()

Use 10ULL, 14ULL, and 600ULL when multiplying by NSEC_PER_SEC in
apple_pmp_test_cool_dark_idle_rate() so 32-bit KUnit builds do not
overflow signed long before conversion to u64.

Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
@IronsideXXVI

Copy link
Copy Markdown
Contributor Author

Forward-merged main (f5bf8bf8d09, which now includes merged #3949) and the updated #3766 head (5d1e0cf98d2), and applied the same ULL 32-bit overflow fix to apple_pmp_test_cool_dark_idle_rate() at 872a79f1f6a9 (no force-push).

Verified offline at 872a79f1f6a9:

@github-actions github-actions Bot removed the merge-conflict Conflicts with the base branch (bot) label Dec 3, 2026
RyanTheTide
RyanTheTide previously approved these changes Dec 3, 2026

@RyanTheTide RyanTheTide 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.

The worker now chooses the next interval after sampling. That puts entry into the warm band on the 100 ms path immediately and keeps errors and active cooling at 5 ms. The longer dark-hold change was dropped, and the revised test widens its duration constants before multiplication. The exact hardware row is still pending.

@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.

Verdict: approved at 872a79f1f6a9. The three points are answered. It merges after #3766 and the rows below.
Blockers: none in the code.

  1. Fixed: the worker re-arms after the sample and reads slow_poll_ms there, so a 92 C sample schedules the next poll at 100 ms.
  2. Fixed: the cap that ended the hold early is gone. apple-pmp-hold.h is byte-identical to #3766 at 5d1e0cf98d21, and the post-wake replay is in KUnit.
  3. Dropped: the idle cap stays 15 s.

Before it merges:

  • #3766 first. Its J604 and J773g rows are open, and if it closes without a gain over main this needs to be redone without it. 52e3af5dd8ac in this branch is our commit; this approval is for the part on top of #3766.
  • J773g at this head (we can run it): 30 min idle desktop with PP1b logged and the sensor error -61 count against main; idle to all-core and idle to GPU ramps against main (peak C, time to the first 5 ms poll); GPU load while the CPUs are dark; 3 s2idle and 3 deep-sleep cycles without sensor errors.
  • J604 at this head: the same idle count and ramps.
  • A fanless T8132 (J713 or J715): the ramps. A 200 ms poll is twice as long unseen below 90 C, so this is the Mac that can show a worse peak.

Checked: the diff ca69b4b55906..872a79f1f6a9. tools/asahi/pmp-thermal-poll-tests.py from this head: pass, 4/4 mutations caught. Below 90 C is the only band that slows down; 95 C and above, faults and cooling still poll at 5 ms, and a guard error now does too. The three 64-bit constants are widened. Binds only on T8132, so no row on another generation.

Not blocking

Tested: and Not yet: still name c36b5a0d3.

@github-actions github-actions Bot removed changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g (Apple Mac mini M4, T8132, G16G B0, os-fw 27.2, 24 GB RAM) hardware row for head 872a79f1f6a9d3a4b11825f267204f4bd915e523 (work/m4rows-b8818ae1-j773g-20261203, kernel 7.3.0-j773g-r1480, local merge b8818ae173f0 on main c43014f079f5, vmlinux build ID ff1e987389e53799e752ac3fc62c843fdb77f70d, boot 5812289d-cae8-43c5-bc9c-0e56c002cce0):

  • Verbatim kit judge line:
    linux#3994: FAIL: PMP/sensor error lines on HEAD (windows ['101'], boot 26 vs stock 66); apple_pmp/temp6_input: idle 50.8 -> peak 107.5 -> cool 55.0 C; stock apple_pmp/temp6_input: idle 55.1 -> peak 107.8 -> cool 56.0 C
  • Breakdown of the matched pmperr lines during the 180 s thermal ramp (tests.sh regex (pmp|thermal|sensor).*(error|fail|timeout)):
    • Stock ramp (pmperr=91, 27 sensors, 55.1 -> 107.8 -> 56.0 C): 80 normal apple-pmp-thermal: decision ... error=0 ... qos_error=0 telemetry lines + 10 sensor error -61 + 1 Temperature check failed (-61) (0 other errors).
    • HEAD ramp (pmperr=101, 27 sensors, 50.8 -> 107.5 -> 55.0 C): 79 normal apple-pmp-thermal: decision ... error=0 ... qos_error=0 telemetry lines + 20 sensor error -61 + 2 Temperature check failed (-61) + 1 decision ... error=-61 (0 other errors).
    • Post-sleep (SLEEP 1..3, 3/3 committed deep sleeps): pmperr=0 on every wake.
    • Boot lines (26 HEAD vs 66 stock): all apple_sep sensor bring-up retry lines (pre-existing on stock).
  • Stock 7.3.0-j773g-main3685+ cleanly restored (boot beaa437c-6c1c-44f0-87be-9a073461f45d).

Verdict: functional PASS; kit judge FAIL on pre-existing -61 + error=0 telemetry regex match (all 27 sensors tracked idle -> load -> cool cleanly on HEAD, 0 non--61 PMP/thermal errors, 0 post-sleep PMP errors).

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 3, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

On the merge tree with main dc68a27f33d8 (e7af20b8e973), the local UML apple-pmp-policy suite passed 17/17 and tools/asahi/pmp-thermal-poll-tests.py passed the positive suite and all four mutation checks. The exact-head J773g functional run found no new error category. The branch still includes #3766 at 5d1e0cf98d21, so #3766 must land first, as called out in the approval.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

PEER-ROWS for 872a79f1f6a9: IronsideXXVI, the J604 (T8132) idle and ramp comparison is still open, along with a ramp comparison on a fanless T8132 (J713 or J715). Compare the same base with #3766 on both builds and this head on the trial build. For the J604, please log PP1b and sensor read errors during 30 minutes of idle. On both Macs, record the idle-to-CPU and idle-to-GPU temperature curves, peak temperature, and time to the first 5 ms poll. Count actual sensor read errors separately from successful decision telemetry.

J773g testing is routed to the lab. #3766 still needs to land first.

@IronsideXXVI

Copy link
Copy Markdown
Contributor Author

Acknowledged — I have not run the exact base+#3766 vs 872a79f1f6a9 comparison on J604 yet, and I do not have a fanless T8132 (J713/J715) on hand, so only the J604 row will come from here.

For context from earlier J604 integrated-kernel runs (neither is a substitute for the isolated exact-head row):

  • An earlier integrated kernel (1.1675) carrying cool_poll_ms=200 without the 15 s cool-idle dark-hold cap / #3766 gate hit 4 PMP sensor error events (serr=30, supp=62, max 2.320 s) during a 620 s idle window.
  • A later integrated kernel (1.1687) carrying cool_poll_ms=200 alongside the 15 s cool-idle cap and #3766 GPU-busy gate saw 0 sensor errors across a 619 s idle window (pmp_sc 9.61 -> 4.89/s, events=0, serr=0, supp=0), though that build was not an isolated base+#3766 vs 872a79f1f6a9 A/B and did not collect the 30-minute PP1b idle or idle-to-CPU / idle-to-GPU ramp curves.

I will queue the isolated J604 A/B on the same base with #3766 on both arms and 872a79f1f6a9 on the trial arm (30-min idle with PP1b and actual sensor read errors counted separately from error=0 decision telemetry, plus idle-to-CPU and idle-to-GPU curves, peak temperature, and time to the first 5 ms poll) and post the full row once captured.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g (Mac mini M4, T8132, OS fw 27.2 / 26B123) isolated A/B follow-up for exact head 872a79f1f6a9d3a4b11825f267204f4bd915e523.

Setup & Isolation

  • Same kernel (7.3.0-j773g-w4248, main 89ec99a075c7 + #4198 aurora.ko 602271b43374), differing only in signed apple-pmp-thermal.ko (the exact 46-line #3994 diff over #3766 5d1e0cf98d21):
    • Base (base3766): 89ec99a0 + #3766 5d1e0cf98d21 (build_id=0db2a920ddd5, boot_id=48d41ad6-1367-4539-b061-1c10311e3781, policy banner 100 ms below)
    • Trial (head3994): 89ec99a0 + #3994 872a79f1f6a9 (build_id=4127e8a8d002, boot_id=ef3d4d1b-39e7-4f21-93df-2a37428986ce, policy banner 100 ms at 90-95 C, 200 ms below 90 C)
  • Telemetry kept separate:
    • idle-pure (120 s): untraced, zero userspace polling (start/end sample_count, governor_count, /proc/interrupts only).
    • Traced phases (idle-30m, ramp-cpu, ramp-gpu, sleeps): ftrace kprobes on apple_pmp_sensor_read entry (channel) + return (ret=$retval:s32) drained unbuffered from trace_pipe (buffer_size_kb=4096), overrun=0, dropped=0 across every phase on both arms.
    • Kernel error counts exclude error=0 / fault=0 / qos_error=0. plasmalogin.service stopped during measurements; 60 s hardware watchdog + dead-man armed; verified M4 VDM route before sleeps.

Results Summary

Metric base3766 (#3766) head3994 (#3994 @ 872a79f1) Notes
Pure idle (120 s, untraced/unpolled) sample=2,980 (24.83 Hz), gov=9.47 Hz, arch_timer=157.61 Hz, klog_err=44 sample=2,206 (18.38 Hz), gov=4.93 Hz, arch_timer=161.10 Hz, klog_err=33 0 fatal kernel errors
30 min idle (idle-30m, 1800 s) PP1b=0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1777, cpu_busy=0.0192, temp_med=46.5 C PP1b=0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1769, cpu_busy=0.0197, temp_med=46.5 C Matched quiet idle
idle-30m cadence & IRQ rate gov=9.572 Hz, arch_timer=175.99 Hz, 100ms=16,886, 5ms=8,559 (~42.8 s = 2.4%) gov=4.976 Hz (-48%), arch_timer=165.66 Hz (-5.9%), 200ms=8,027, 5ms=25,824 (~129.1 s = 7.2%) 3.0x more 5 ms recovery cycles on head
idle-30m total cycles & true -61 reads 25,446 cycles (14.143 Hz), 150,771 raw -61 (5,027.8/min, 5,925.1/1k cyc), 0 other <0 33,852 cycles (18.815 Hz, +33%), 201,034 raw -61 (6,704.0/min, 5,938.6/1k cyc), 0 other <0 Identical per-cycle -61 rate; +33% net polls from 5 ms error recovery
idle-30m 15 s hold-expiry episodes 18 (>=15 s spans: 18, max 16.895 s), 169 sensor error -61 warns, 11 sysfs temp err ticks 50 (>=15 s spans: 49, max 23.674 s), 482 sensor error -61 warns, 43 sysfs temp err ticks 2.7x more 15 s idle-hold expirations
Idle-to-all-core ramp (20 s pre + 60 s 10-core + 90 s cool) 46.50 -> 106.00 C; first 5 ms poll at +26.609 s (94.25 C); load -61: 6,766/6,766 cyc (1000/1k, idle GPU ch5 only); 0 load klog errs, 1 cool-down expiry burst (10 warns at +109.6 s) 44.00 -> 106.25 C; 200->100 ms at +17.985 s (90.00 C), first 5 ms poll at +27.047 s (94.75 C); load -61: 6,591/6,591 cyc (1000/1k, idle GPU ch5 only); 0 load klog errs, 2 cool-down expiry bursts (20 warns at +103.7 s, +148.4 s) 3-tier ramp works cleanly; explains prior 10 vs 20 ramp warns (all in post-load idle cool-down)
Idle-to-GPU & GPU-only CPUs dark (90 s gpubench-vk render.heavy 1080p --verify) PASS CRC=3f86e0cf (371.97 us/sub), gpu_only=320/363, cpu_busy=0.1716, PP1b med=22,134 mW, 48.50 -> 87.25 C (<95 C, 100 ms: 872 load cyc, 3,176 -61 = 3,642/1k cyc, 0 klog errs), max all-ch dark 0.417 s (0 spans >=2 s) PASS CRC=9c7a452d (371.86 us/sub), gpu_only=307/364, cpu_busy=0.1801, PP1b med=22,039 mW, 46.75 -> 87.25 C (<90 C, 200 ms: 437 load cyc = 2x cut, 1,645 -61 = 3,764/1k cyc, 0 load klog errs, 1 cool-down expiry at +120.7 s), max all-ch dark 0.832 s (0 spans >=2 s) GPU-only never hit a contiguous >=2 s all-ch -61 span on either arm (not treated as #3766 guard non-coverage)
Sleeps (3 s2idle + 3 deep) 3/3 s2idle PASS, 3/3 deep PASS (same_boot=y, ready=Y, error=0, fault=0, 0 PMP/fatal klog errs) 3/3 s2idle PASS, 3/3 deep PASS (same_boot=y, ready=Y, error=0, fault=0, 0 PMP/fatal klog errs) Clean wake resumption on both

Ramp Curves (temp from load start)

  • All-core CPU (+0..+60 s load, +60..+150 s cool):
    • base3766: +0s:61.00C +5s:79.00C +10s:84.75C +15s:88.50C +20s:91.75C +25s:94.00C +30s:96.50C +40s:101.00C +50s:105.00C +60s:95.75C +75s:62.25C +90s:60.25C +120s:55.25C +150s:52.75C
    • head3994: +0s:43.75C +5s:80.00C +10s:84.25C +15s:88.00C +20s:91.50C +25s:94.25C +30s:96.25C +40s:101.00C +50s:104.50C +60s:78.75C +75s:62.75C +90s:60.25C +120s:55.25C +150s:52.50C
  • GPU-only (+0..+90 s load, +90..+150 s cool):
    • base3766: +0s:48.50C +10s:63.75C +20s:69.00C +30s:73.75C +45s:77.75C +60s:81.50C +75s:84.25C +90s:86.50C +105s:67.75C +120s:65.50C +150s:58.50C
    • head3994: +0s:46.75C +10s:63.00C +20s:69.00C +30s:73.50C +45s:71.00C +60s:81.50C +75s:84.50C +90s:87.00C +105s:71.75C +120s:70.00C +150s:59.25C

Key Takeaway

Active-load ramp tracking (200 -> 100 -> 5 ms), peak temperatures (106.0 vs 106.25 C CPU, 87.25 vs 87.25 C GPU), GPU-only stability, and 3 s2idle + 3 deep wakes are all clean on 872a79f1f6a9. However, on quiet J773g idle, halving the cool poll rate to 200 ms interacts with #3766's 15 s all-channel-dark hold ceiling: clusters stay dark past 15 s 2.7x more often (50 vs 18 episodes in 30 min, max 23.67 s vs 16.90 s), which drops into 5 ms hrtimer error recovery + level=8 caps + ratelimited sensor error -61 warnings (482 vs 169), causing +33% more total sample_count cycles over 30 min idle (33,852 vs 25,446) even while governor_count drops 48% and arch_timer IRQs drop 5.9%. This also accounts for the earlier run's 10 base vs 20 head ramp warnings (1 vs 2 post-ramp idle cool-down hold-expiry bursts, 0 during active load).

@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.

Changes requested at 872a79f1f6a9. In the 30-minute J773g idle comparison with #3766 on both arms, the 200 ms poll increased 15-second all-dark hold expirations from 18 to 50 (2.7×) and 5 ms recovery cycles from 8,559 to 25,824 (3.0×). Total sample cycles rose from 25,446 to 33,852 (+33%), and -61 warnings rose from 169 to 482. The earlier 10 to 20 ramp warnings all came during cool-down. Active load and all three deep plus three s2idle cycles were clean.

Please make the smallest change that prevents the slower poll from driving those extra hold expirations while preserving fast recovery for genuine sensor faults. For example, keep the existing cadence during an active all-dark hold. We’ll repeat the isolated J773g idle comparison at the updated head. J773g results

@DjDeveloperr DjDeveloperr removed the ready-to-merge Meets the merge policy: merge it (bot) label Dec 4, 2026
@github-actions github-actions Bot added changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 4, 2026
In isolated 30-minute J773g idle testing against aurora-silicon#3766, slowing cool
polling to 200 ms across active all-dark holds halved the number of
probes inside the 15 s hold cap, increasing hold expirations from 18 to
50 (2.7x) and 5 ms error-recovery cycles from 8,559 to 25,824 (3.0x),
raising total idle sample cycles by 33%.

Pass whether the current sample is served from an active dark hold
(`raw_ret && !ret`) into apple_pmp_poll_interval_ms() so cool polling
only uses 200 ms on fresh readings (< 90 C) and keeps the existing
100 ms cadence while an all-dark hold is active. Genuine sensor faults,
expired holds, cooling, recovery, and >= 95 C continue to take the 5 ms
fast hrtimer path immediately.

Extend apple-pmp-policy KUnit and tools/asahi/pmp-thermal-poll-tests.py
(including a 5th mutation check that dark holds do not slow to 200 ms).

Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Dec 4, 2026
@IronsideXXVI

Copy link
Copy Markdown
Contributor Author

Thanks for catching that on J773g, @DjDeveloperr — that explains the 2.7× jump in 15 s hold expirations and 3.0× jump in 5 ms recovery cycles cleanly.

Pushed forward-only commit f4188ec01bb1 (thermal: apple-pmp: keep 100 ms cadence during active all-dark holds, no force-push):

  • Pass whether the current sample is served from an active dark hold (raw_ret && !ret) into apple_pmp_poll_interval_ms() so 200 ms slow polling is only used on fresh cool readings (< 90 C), while an active all-dark hold keeps the existing 100 ms cadence (APPLE_PMP_SLOW_POLL_MS) through the 15 s cap.
  • Genuine sensor faults, expired holds, cooling/recovery, and >= 95 C continue to take the 5 ms fast hrtimer immediately.
  • Updated the startup policy banner to (100 ms at 90-95 C or dark-held, 200 ms below 90 C).

Offline verification at exact head f4188ec01bb1:

  • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks (302 lines on f4188ec01bb1; 818 lines on origin/main...HEAD).
  • git merge-tree against origin/main (e66db56bed9): 0 conflicts.
  • Clang 18.1.8 ARM64 LLVM=1 W=1 KCFLAGS="-Werror": drivers/thermal/apple-pmp-thermal.o (329360 B) and drivers/thermal/apple-pmp-policy-test.o (277720 B), 0 warnings / 0 errors.
  • ARM64 QEMU KUnit apple-pmp-policy (KASAN+UBSAN): 17/17 PASSED (covering fresh 200 ms, active dark-hold 100 ms, warm 100 ms, and 5 ms fault/cooling/hot paths).
  • Host poll & mutation tests (python3 tools/asahi/pmp-thermal-poll-tests.py, -Wall -Wextra -Werror -fsanitize=undefined): PASS + 5/5 mutations caught (added a 5th mutation verifying dark holds do not slow to 200 ms).

Ready for the repeat isolated J773g idle comparison at f4188ec01bb1, and I will run the isolated J604 base+#3766 vs f4188ec01bb1 comparison at this updated head.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 4, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

The cadence change matches the review finding. Fresh cool readings use 200 ms, held readings use 100 ms, and errors or active cooling still take the 5 ms path. I ran the poll host test and all five mutation checks successfully.

The merge hold stays in place until the isolated 30-minute J773g idle comparison measures hold expirations, recovery cycles, total samples and sensor errors on the new build. The J604 comparison is with IronsideXXVI.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g (Mac mini M4, T8132, OS fw 27.2 / 26B123) isolated 30-minute A/B follow-up at exact head f4188ec01bb184682c9ba756ee29f3f3d145d9fe.

Setup & Isolation

  • New sealed kit (KIT.sha256 d7f45bc71cba913f82455e4eeb27a8e50eb87bb9d74ef7f5663c01acdcf08b7c), reusing the identical isolated methodology over #3766 on 7.3.0-j773g-w4248 (main 89ec99a075c7, 1.0.0b19-g06c581d1), differing only in signed apple-pmp-thermal.ko:
    • Base (base3766): #3766 (build_id=0db2a920ddd5, boot_id=251c657f-9f3b-4eac-a42c-c4566c7c3605, banner: 5 ms sampling from 95 C or while cooling (100 ms below), 100 ms governor)
    • Head (head3994 @ f4188ec0): f4188ec01bb1 (build_id=b29f437197f4, boot_id=b363e132-b2d4-4e89-b505-84b66c1912f8, banner: 5 ms sampling from 95 C or while cooling (100 ms at 90-95 C or dark-held, 200 ms below 90 C), 100 ms governor)
  • Ftrace kprobes on apple_pmp_sensor_read entry/return (overrun=0, dropped=0 across every phase on both arms); plasmalogin.service stopped; 60 s hardware watchdog + dead-man armed; verified M4 VDM route before sleeps.
  • Retained logs: work/j773g-linux3994-f4188ec0-20261204/results/run-20261204T090847Z

Exact-Head Comparison (f4188ec0 vs Paired base3766 and Prior 872a79f1)

Metric Prior base3766 (05:25Z) Prior #3994 @ 872a79f1 Paired base3766 (09:08Z) New #3994 @ f4188ec0 Delta (f4188ec0 vs paired base)
Pure idle (120 s, untraced/unpolled) sample=2,980 (24.83 Hz), gov=1,137, arch_timer=18,918 sample=2,206 (18.38 Hz), gov=592, arch_timer=19,337 sample=1,972 (16.43 Hz), gov=1,149, arch_timer=22,421 sample=2,335 (19.45 Hz), gov=1,119, arch_timer=25,749 +18.4% samples, -2.6% gov
30 min idle (idle-30m) PP1b & state 0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1777, temp_med=46.50 C 0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1769, temp_med=46.50 C 0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1779, cpu_busy=0.0153, temp_med=45.25 C 0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1773, cpu_busy=0.0193, temp_med=45.75 C Matched quiet idle
idle-30m total sample_count delta 25,446 (14.143 Hz) 33,852 (18.815 Hz, +33.0%) 32,672 (18.159 Hz) 40,967 (22.769 Hz) +25.4% (still above base)
idle-30m governor_count / arch_timer 17,222 (9.572 Hz) / 316,656 (175.99 Hz) 8,953 (4.976 Hz, -48%) / 298,065 (165.66 Hz) 17,096 (9.502 Hz) / 276,744 (153.81 Hz) 16,861 (9.371 Hz) / 303,017 (168.41 Hz) -1.4% gov, +9.5% arch_timer
idle-30m 15 s hold expirations (>=15 s all-dark spans) 18 (max 16.895 s) 49 (max 23.674 s) 30 (max 19.114 s, 31 5 ms bursts) 43 (max 20.295 s, 50 5 ms bursts) +43.3% expirations (+61% bursts)
idle-30m 5 ms recovery cycles (<=15 ms) 8,559 (~42.8 s = 2.4%) 25,824 (~129.1 s = 7.2%) 16,151 (~80.8 s = 4.5%) 25,034 (~125.2 s = 7.0%) +55.0% 5 ms recovery cycles
idle-30m 100 ms / 200 ms cycles 16,886 / 0 0 / 8,027 16,520 / 0 15,772 / 160 100 ms restored on cached dark
idle-30m raw -61 (ENODATA) reads 150,771 (5,027.8/min) 201,034 (6,704.0/min) 194,230 (6,477.1/min, 5,944.9/1k cyc) 243,811 (8,130.5/min, 5,951.4/1k cyc) Identical per-cycle -61 rate
True sensor errors (non--61) / fatal klog 0 / 0 (ret_other_neg=0) 0 / 0 (ret_other_neg=0) 0 / 0 (ret_other_neg=0) 0 / 0 (ret_other_neg=0) 0 true sensor errors; all klog errs are -61 expiry warns (556 vs 334 in idle-30m; 648 vs 400 full boot)
Full-boot sample_count (end of sleeps) — — 48,255 (idle30m: 3,489 -> 36,161) 57,923 (idle30m: 3,291 -> 44,258) +20.0% full-boot total
CPU ramp (20 s pre + 60 s 10-core + 90 s cool) peak 106.00 C, t_5ms=26.609 s peak 106.25 C, t_100ms=17.985 s, t_5ms=27.047 s sample=7,306, peak 105.50 C, t_5ms=29.838 s, 0 klog errs sample=8,437, peak 105.50 C, t_100ms=19.874 s, t_5ms=29.457 s, 24 cool-down -61 warns Clean 200->100->5 ms ramp (1,313 cool-down 5 ms cyc on head vs 2 on base)
GPU-only (90 s gpubench-vk render.heavy) PP1b med=22,134 mW, peak 87.25 C, 872 load cyc (104 ms) PP1b med=22,039 mW, peak 87.25 C, 437 load cyc (208 ms) PP1b med=22,178 mW, peak 85.75 C, 877 load cyc (104 ms), 0 dark >=2 s PP1b med=22,146 mW, peak 86.25 C, 534 load cyc (208 ms med: 339 at 200 ms, 195 at 100 ms), 0 dark >=2 s, status=ok, valid=True, 89.19 Gpix/s -39% GPU load poll cycles
Sleeps (3 s2idle + 3 deep) 3/3, 3/3, 0 errs 3/3, 3/3, 0 errs 3/3, 3/3, 0 errs 3/3, 3/3, 0 errs Clean wake resumption

Cadence Breakdown (idle-30m ftrace: interval following fresh vs all-dark sample)

  • base3766:
    • After fresh sample: 100 ms = 272, 200 ms = 0, 5 ms = 324
    • After all-dark (-61) sample: 100 ms = 16,248, 200 ms = 0, 5 ms = 15,827
  • head3994 @ f4188ec0:
    • After fresh sample: 100 ms = 0, 200 ms = 160, 5 ms = 457
    • After all-dark (-61) sample: 100 ms = 15,772, 200 ms = 0, 5 ms = 24,577

Takeaway

  • Cadence behavior works as intended on f4188ec0: 100 ms is preserved on every cached all-dark sample (15,772 at 100 ms, 0 at 200 ms), 200 ms is used after fresh cool samples (160 in idle-30m and 339/534 during cool GPU load), governor_count is restored (9.371 Hz vs 9.502 Hz, -1.4% vs -48% at 872a79f1), active CPU/GPU ramps and 6/6 sleeps pass cleanly, and true (non--61) sensor errors are 0.
  • Idle sample count on J773g: In this 30-minute run, head3994 @ f4188ec0 still recorded +25.4% more total idle-30m samples than its paired base3766 (40,967 vs 32,672, with 43 vs 30 >=15 s hold expirations and 25,034 vs 16,151 5 ms recovery cycles), compared with +33.0% at 872a79f1. Note that J773g idle dark-span frequency also has substantial run-to-run variance even on unmodified #3766 (base3766 itself moved from 18 to 30 >=15 s expirations and 25,446 to 32,672 samples between the 05:25Z and 09:08Z runs), and on quiet J773g idle only 0.39% (160 / 40,966) of cycles take the 200 ms path (the single step immediately following a fresh reading before returning to 100 ms while dark-held).

@IronsideXXVI

Copy link
Copy Markdown
Contributor Author

Thanks for running the isolated 30-minute J773g A/B at f4188ec0, @DjDeveloperr.

Looking at both J773g runs alongside our J604 behavior, cool_poll_ms=200 does not deliver the idle reduction it was meant to achieve:

  • Slowing dark-held polls to 200 ms (872a79f1) pushed quiet idle dark spans past the 15 s cap (49 vs 18 expirations, 25,824 vs 8,559 5 ms recovery cycles, +33.0% total idle samples).
  • Keeping dark-held polls at 100 ms (f4188ec0) fixes the cadence on paper, but on quiet J773g idle only 160 / 40,966 (0.39%) of cycles even take the 200 ms path (the single step after a fresh reading), while total idle samples still came in above paired base (40,967 vs 32,672, +25.4%; 5 ms recovery cycles +55.0%; arch_timer +9.5%).
  • On J604 we also dropped cool_poll_ms=200 from our daily kernel after seeing -61 hold-expiry events on idle and kept main's 100 ms slow poll, which runs cleanly with 0 sensor errors across 620 s idle windows.
  • The only real reduction remaining at f4188ec0 is during active cool GPU load (534 vs 877 poll cycles over 90 s, ~3.8 Hz fewer polls under ~22 W GPU load), which does not justify the extra state or the doubled 200 ms blind window below 90 C.

Unless you think the active-GPU-only 200 ms reduction is still worth carrying, I plan to close #3994 and keep main's 100 ms slow poll (leaving #3766 as the standalone GPU-busy hold change). Let me know if you agree and I'll close it out.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Agreed, please close #3994 and keep the 100 ms slow poll. At f4188ec0, J773g still recorded 25.4% more idle samples and 55% more 5 ms recovery cycles than the paired base. The reduction during cool GPU load does not justify the longer interval between thermal readings. Keep the GPU-busy hold in #3766 separate.

@IronsideXXVI

Copy link
Copy Markdown
Contributor Author

Closing as agreed — keeping main's 100 ms slow poll.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants