Repository navigation
soc: apple: clpc: enable on-time idle sampling on T8132 - #3882
Conversation
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed 1541a10. Turning idle_on_time on for T8132 is reasonable (T6041, T6050 and T8142 already use it). Two blockers:
- Host tests will fail. tools/asahi/clpc-gpu-demand-tests.py:940 asserts
!apple_clpc_hw_t8132.idle_on_time. Update that assertion with the table change. - Runtime switch. The idle_on_time module parameter is an A/B knob; merged code has to pick its behaviour itself. Drop the parameter, apple_clpc_idle_on_time() and the test that writes the global, and keep
.idle_on_time = truein apple_clpc_hw_t8132 with a KUnit/host check of the table. Note the per-CPU idle timers are only allocated at probe when the table says idle_on_time, so the override never had the same effect as the table on other SoCs anyway.
After that the remaining gate is a row at the new head on a T8132 Mac.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
On T8132 (M4), apple_clpc_hw_t8132 leaves idle_on_time disabled, so after 32 ms without a held vote CLPC switches to deferrable idle_work. On a quiet NO_HZ system, a single-threaded memory-bound workload waking from a short sleep can sit at DCS 0 / fabric 0 (~345 ns DRAM latency instead of ~97 ns) for 0.2 to 1.5 seconds until an unrelated timer wakes the deferrable worker. Enable idle_on_time on apple_clpc_hw_t8132, matching apple_clpc_hw_t6041, apple_clpc_hw_t6050, apple_clpc_hw_t8142, and apple_clpc_hw_t8152, so per-CPU deferrable idle timers keep idle NO_HZ CPUs at zero CLPC wakeups while active cores still sample on time. Update the T8132 KUnit table check and tools/asahi/clpc-gpu-demand-tests.py assertions to match. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
1541a10 to
e9c20ef
Compare
|
Thanks for the review — addressed both blockers and rebased onto
Verified offline at
Will follow up with a live J604 hardware boot row at |
satchlj
left a comment
There was a problem hiding this comment.
Code audit clean at e9c20ef1b0b3 — awaiting exact-head hardware row & prior review clearance
Reviewed drivers/soc/apple/clpc.c and tools/asahi/clpc-gpu-demand-tests.py:
- Setting
.idle_on_time = trueonapple_clpc_hw_t8132matchest6041/t6050/t8142/t8152, drops the earlier module parameter cleanly, and updates both the KUnit assertion (apple_clpc_t8132_gpu_input_test) andclpc-gpu-demand-tests.py. - All CI checks pass at
e9c20ef1b0b3.
Remaining before approval:
- Exact-head T8132 hardware boot/idle row at
e9c20ef1b0b3(as listed inNot yet). - Re-review from
@DjDeveloperrto clear the earlierCHANGES_REQUESTED.
Addressed at e9c20ef: the module parameter is gone and the host-test assertion is updated. The exact-head hardware row is what's left before merge.
One conflict, in drivers/soc/apple/clpc.c: the T8132 table gets .ane from aurora-silicon#2856 and .idle_on_time from this branch on the same line. Keep both. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
I merged There was one conflict, in the T8132 table in Local checks on the merge (clang 23, arm64): W=1 Still needed: a T8132 hardware row on this head. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 491e031bb6808aa5d1568f71cf16c32cc15cfb22
Blockers:
- A T8132 hardware row at this head. We will run it on J773g (M4 mini) in the next M4 composite. The J604 run in the PR body was an older build, so it doesn't count for this head. The row should show:
- a short-sleep, memory-bound load gets its DCS and fabric floor right away (the latency this PR is about);
- idle wakeups and idle power are no worse than
main; - the ANE floor from #2856 still rises and drops;
- one clean deep sleep, no new kernel errors.
The code has no blockers.
Checked: the whole diff against main, the merge commit, every board this reaches, the interaction with #2856 and #3868, and local builds. I didn't write the merge and read it fresh.
The merge commit. Beyond what git merges by itself it only resolves the T8132 table, keeping .ane from #2856 and .idle_on_time from this PR. The lines this PR adds and removes are the same as at e9c20ef1b0b3. The two points of the earlier review (the module parameter and the stale host-test assertion) are fixed.
Which Macs. idle_on_time is a field of the apple,t8132-clpc table, not a devicetree property. So every T8132 Mac gets it: J604, J623, J624, J713, J715 and J773g. The busy-share properties in t8132-memory.dtsi copy the table and keep the field. No other Mac changes. T6041, T6050 and T8142 already have it; T6040, T8140, T8152 and the generic table stay off. The PR text lists T8152 as already on, which is wrong; the code comment is right.
What changes on those Macs.
- With no floor held, one pinned deferrable timer per online CPU replaces the single deferrable work item. It never wakes an idle CPU; a CPU that has been busy for a sample period starts the sampling.
- GPU and ANE work still queues a sample at once. While a floor or the ANE CPU request is held, sampling stays on time, so the #2856 floor is released as before.
- Suspend and unbind delete the timers and then cancel the work once more; resume arms them again. A failed allocation in probe frees the clusters and returns.
- Booted with
nohz_full=, these Macs would sample every 4 ms even when idle, as the other three tables already do. The default command line doesn't set it.
With #3868 (now in main): no conflict. The checks below ran on the two together.
Evidence
Local, on this head merged with main 5fe340acef00 and #3868 (tree a99f1ce542af, all 1830 CLPC, DT, binding and script sources matched to that tree by hash). clang 23.1.3, arm64:
W=1 drivers/soc/apple/clpc.o: 0 warnings, without KUnit and withCONFIG_KUNIT=y(compiled, not run).run-host-tests.py --only clpc: 9/9, with the T8132 assertions this PR updates.t8132-j773g,t8132-j604andt8142-j815DTBs build;dt_binding_checkon both CLPC bindings is clean.
|
J773g (M4 Mac mini,
|
There was a problem hiding this comment.
Verdict: MERGE at 491e031
Checked: The T8132 SoC profile joins the existing pinned deferrable idle-timer path. I traced timer arming, CPU hotplug and suspend cleanup, and verified the final merge keeps both the ANE floor and idle_on_time. Both exact host suites passed and detected all 47 negative controls. The posted J773g composite includes this head and reports zero CLPC update errors through idle, load and s2idle. #3882 (comment)
Follow-ups: The PR description lists T8152 among the profiles with idle_on_time enabled. The current table leaves it off.
|
J773g (
|
RyanTheTide
left a comment
There was a problem hiding this comment.
T8132 opts into the existing pinned, deferrable idle timer path. The tests preserve the separate ANE floor, and the exact J773g row covers idle, load and s2idle with zero update errors.
|
J773g (Apple M4 Mac mini, Exact commits / DTB provenance on this boot (single J773g generation):
Verified results:
|
|
Local checks on the merge of
Rows: J773g at this head (idle, load, s2idle on 12-03, then three deep sleeps today with the GPU back at full clock after each). J604 only on an older build. No row on J623, J624, J713, J715. |
What: Enable
idle_on_timeonapple_clpc_hw_t8132indrivers/soc/apple/clpc.c(matchingapple_clpc_hw_t6041,apple_clpc_hw_t6050, andapple_clpc_hw_t8142) so single-threaded memory-bound workloads waking from a short sleep do not sit at DCS 0 / fabric 0 waiting on deferrableidle_work, while per-CPU deferrable idle timers keep idleNO_HZCPUs at zero CLPC wakeups. Update the T8132 KUnit table check andtools/asahi/clpc-gpu-demand-tests.pyassertions to match.Tested:
aurora-silicon/linuxmain(2225082e1, branchj604-clpc-t8132-idle-on-time, heade9c20ef1b0b3, merged cleanly withmainb902937859ecat491e031bb680):tools/asahi/clpc-gpu-demand-tests.py: PASS (2 positive suites + 47 negative controls, 0 failures).scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks (41 lines checked).LLVM=1 W=1(clang 23.1.5):drivers/soc/apple/clpc.o0 warnings (368464bytes).drivers/soc/apple/clpc.kunitconfig):apple-clpc-gpu15/15 passed (0 failed, 0 skipped), includingapple_clpc_t8132_gpu_input_test..idle_on_time = trueenabled (linux-aurora 7.3.0.aurora1-1.1683, boot5440e161): PMP events 0, idle die 34.0 C, deep sleep suspend/wake PASS (rc=0), 0 kernel faults, 0 failed systemd units.491e031bb680(comment #7366257374): PASS.Risk: two-way · M4 (T8132) — on standard
!tick_nohz_fullkernelsidle_on_timeuses per-CPUTIMER_DEFERRABLE | TIMER_PINNEDidle timers (clpc->idle_timers) for zero idle wakeups; a plain revert restores deferrableidle_workon T8132.Not yet:
491e031bb680and verification on non-J604/J773g T8132 boards (J713/J715).Details and verification
Scope (
j604-clpc-t8132-idle-on-time, head491e031bb680)drivers/soc/apple/clpc.c(+7 / -0)tools/asahi/clpc-gpu-demand-tests.py(+2 / -2)Signed-off-by: Dylan Ironside <dylan@dylanironside.io>tools/asahi/clpc-gpu-demand-tests.py: 2/2 positive suites + 47/47 negative controls PASS.scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks (41 lines checked).LLVM=1 W=1(clang 23.1.5):drivers/soc/apple/clpc.o0 warnings (368464bytes).apple-clpc-gpu15/15 passed (0 failed, 0 skipped).Mechanism summary
main,apple_clpc_hw_t8132left.idle_on_timeunset (false), whilet6041,t6050, andt8142enable.idle_on_time = true.NO_HZsystem, leavingidle_on_timedisabled lets a single-threaded memory-bound workload waking from a short sleep sit at DCS 0 / fabric 0 (~345 ns DRAM latency instead of ~97 ns) for 0.2–1.5 s until an unrelated timer wakes deferrableidle_work..idle_on_time = trueonapple_clpc_hw_t8132aligns T8132 with the other M4/M5 SoC tables and allocates per-CPU deferrable idle timers at probe.