Repository navigation
thermal/drivers/apple-pmp: sample fast while dark and busy - #3267
Closed
themartiano wants to merge 1 commit into
Closed
themartiano wants to merge 1 commit into
themartiano wants to merge 1 commit into
Conversation
A light load runs its cluster for only part of each 100 ms slow poll period. A load with a matching period can keep every sample in the gated part until the 2 s hold expires, and both clusters then go to their minimum frequency. Measured on an older tree on a J713 with the idle hold but without this: 3 of 6 loads pinned to one P or E core at 20, 30 and 60 % were clamped or lost the sensors (P30, E30, E60). With this, 0 of 6. Sample at the fast cadence while the sensors are dark and the CPUs have work, so a real reading is found before the hold expires. The hold and its limits are unchanged, and an idle machine keeps the slow cadence. Signed-off-by: Eduardo <git@martiano.me>
Contributor
|
We carry this PR on top of #2774 in our J713 (M4 Air, T8132) daily kernel. Even with #2774 in place alongside #3546, light periodic workloads that wake a cluster for only part of each 100 ms slow poll can beat against the poll interval so every sample lands while the cluster is power-gated ( Running smoothly together with #2774 on our J713 daily kernel without light-load dark-sensor frequency clamps. |
RyanTheTide
deleted the branch
aurora-silicon:djdev/apple-pmp-thermal-idle-enodata
December 1, 2026 18:05
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: On top of #2774 and relies on it: the base is its branch, so only this commit shows. A light load runs its cluster for only part of each 100 ms slow poll. A load with a matching period can keep every sample in the gated part until the 2 s hold expires, and both clusters then drop to their minimum frequency. This samples at the fast 5 ms cadence while all sensors are dark and the CPUs have work, so a real reading is found before the hold expires. The hold, its caps and every temperature limit stay as they are. An idle machine keeps the slow cadence.
Tested: Host side at 472a67f: arm64 build of
drivers/thermal/(W=1, LLVM 18, Rust 1.99, edge config, APPLE_PMP_THERMAL=m), 0 warnings. KUnitapple-pmp-policy11/11 on arm64 QEMU; the newapple_pmp_test_dark_fastfails with the helper stubbed out (10/11). Host tests--only pmp20/22 (the twopmp-agx-vote-testsjobs needsetarch, which the build container denies).test-thermal-policy.pypasses (571828 rows). checkpatch --strict clean. Hardware: J713 13-inch M4 Air (fanless, 26.6.2, on AC) with this diff, not at 472a67f itself: #2774 conflicts with main, so the kernel (7.3.0-0.next2) was main ba29027 plus #2774 rebased onto it, this commit on top (96fb3e5ede28, same diff), and all our other open branches combined. Result: idle, 0 % of 1200 samples with P or E at minimum, 5 all-dark spans over 2 s (longest 3.3 s), 0-61; job after 8 s idle (15x) median 87 ms, worst 101 ms; one P and one E core pinned at 20/30/60 %, 0 of 6 clamped, P and E at maximum throughout, peak 80 C, 0-61; 10 of 10 deep sleeps, 0 kernel errors, 0 failed units.Risk: two-way · M4 (T8132) Macs that run the PMP sampler: J713, J715, J604, J773g, J623, J624. More 5 ms polls while the sensors are dark and the CPUs are busy; no limit changes.
Other Macs: The sampler only registers under
apple,t8132-pmp-v2, so only the M4 Macs above run this code; no other Mac is affected. On the M4 Macs with fans (J604, J773g, J623, J624) the same light-load clamp can happen when the clusters gate, and this helps the same way. It cannot raise a limit or lengthen any time without a reading; dark-and-busy time without one can only get shorter. The cost is 5 ms polls while dark and busy. Rows so far come only from the J713.Not yet: a row at this exact head. From the J713 rows asked for on #2774: ANE-only load (the ANE does not start on main with the current boot loader), 30 min idle, a deep sleep right after a hot load, a soak on battery, and all-core and GPU-only load on today's kernel (they exist only from an older tree, below). Rows from a Mac with a fan.
Details
apple_pmp_dark_fast()inapple-pmp-hold.h: the raw sample is-ENODATAand the CPUs are not idle (thermal/drivers/apple-pmp: ride out idle dark sensors and preserve zone backoff #2774's idle tracker).apple_pmp_sample()ORs it into the fast-poll decision.APPLE_PMP_GATED_HOLD_MC(100 C since 3882292) instead of the 90 C at thermal/drivers/apple-pmp: ride out idle dark sensors and preserve zone backoff #2774's head. Every reading in the J713 rows of today stayed at or below 80 C.J713 rows asked for on #2774, and where they stand (J713, fanless, 26.6.2, AC, one run per row):
7.3.0-0.next2(main + rebased #2774 + this)-61, peak 49.5 C-61, 0 % at minimum, longest dark 4.4 s-61Dark spans are counted with all six records dark, not per record.
Evidence
djdev/apple-pmp-thermal-idle-enodata).make LLVM=/usr/lib/llvm18/bin/ ARCH=arm64 W=1 drivers/thermal/with Rust 1.99 and the edge kernel config;apple-pmp-thermal.obuilt, 0 warnings.tools/testing/kunit/kunit.py run --arch=arm64with KUNIT, THERMAL, APPLE_PMP_POLICY_KUNIT_TEST, filterapple-pmp*: 11/11. Withapple_pmp_dark_fast()returning false:apple_pmp_test_dark_fastfails, 10/11.tools/asahi/run-host-tests.py --only pmp: 20/22; both failures aresetarch: failed to set personality ... Operation not permitted.tools/testing/selftests/drivers/gpu/asahi-m4/test-thermal-policy.py: passed, 571828 rows.7.3.0-0.next2: main ba29027 plus our open kernel branches (PMP thermal on rebased thermal/drivers/apple-pmp: ride out idle dark sensors and preserve zone backoff #2774, DCP audio, Thunderbolt/DART, display), plus drm/asahi: g16: admit 25G83 on every T8132 Air with one normalized entry #2672, drm/apple: turn framebuffer damage into a commit #2797 and arm64: dts: apple: t8132-j713-j715: DisplayPort alt mode on both USB-C ports #2807. Firmware 26.6.2. PMP rows fromidle.py,duty.py(no all-core load, stop at 95 C) and the deep-sleep script with a 60 s RTC wake alarm.