Skip to content

soc: apple: clpc: T6050: sample on time with no vote held - #1556

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/t6050-clpc-sample-on-time
Nov 11, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/t6050-clpc-sample-on-time

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

T6050's CLPC now samples every 4 ms even when it holds no vote. Until now it sampled from a deferrable timer in that state, and the DRAM floor didn't come up after an idle spell.

Problem

With no vote held, the CLPC samples from a deferrable timer, which only fires when the CPU that armed it wakes for something else. So when a CPU goes busy after an idle spell, the CLPC doesn't see it until that other CPU happens to wake.

On the M5 Pro (J714sAP), a pointer chase that starts 300 ms after the last work ran at DRAM state 0 (about 300 ns per load) for the whole 60 ms it was measured. It ran at 110 ns once the floor was up.

Change

  • New per-SoC flag idle_on_time: with no vote held, keep sampling every period instead of from the deferrable timer.
  • Set for T6050 only. The other SoCs keep the deferrable timer until it is measured on them: it was a deliberate power choice ("rather than waking an idle one every period").
  • The T6050 comment now says what macOS's CLPC does instead of claiming the DCS 5 / fabric 2 map is macOS's vote. Traced under aura on J714sAP (26A428):
    • it votes from memory stalls: no vote for one CPU-bound thread, DCS 2 for an 18-thread spin, DCS 6 / fabric 2 for memcpy and for a pointer chase;
    • this driver doesn't see stalls, so it keeps its frequency map. DCS 5 / fabric 2 keeps a pointer chase at 110 ns against 300 ns at state 0.

Validation (J714sAP, MEAS 2026-11-11)

Pointer chase on CPU 12 starting after a 300 ms sleep, median of 20, DRAM latency at 0 / 16 / 24 / 32 / 59 ms:

kernel latency after idle idle total power (SMC)
default set 7.3.0-m5-argb2 (run l1) 304 / 300 / 300 / 299 / 300 ns 6.1-6.4 W across boots
one-boot A/B (run k1), deferrable (as now), 2 rounds 306 / 302 / 303 / 302 / 303 ns; 306 / 300 / 300 / 299 / 301 ns 6.40 / 6.40 W
one-boot A/B (run k1), on time, 2 rounds 304 / 302 / 112 / 110 / 111 ns; 307 / 301 / 280 / 110 / 111 ns 6.40 / 6.48 W
this PR exactly (run k2, 7.3.0-m5-lm2c = argb2 + this PR + #1555), 2 runs 308 / 301 / 116 / 110 / 111 ns; 305 / 302 / 112 / 110 / 111 ns 6.46 W
  • The floor is in place 24-32 ms after the thread goes busy (three busy samples, plus cpufreq reaching the upper half of the range). The idle power difference is within the SMC's noise.
  • Unchanged in k2:
    • CPU floor DCS 5 / fabric 2 for spin, pointer chase (109.6 ns) and 18-thread memcpy (243.6 GB/s);
    • GPU floor DCS 6 / fabric 3 (gpubench compute.heavy bw 487.0 µs/submit, compute.light 31.9 µs);
    • 0 update errors, no oops/WARN/SError, desktop boot.
  • Built incrementally on the default kernel's tree (argb2, 5c481329ed32); the patch applies unchanged to integration/aurora.

🤖 Generated with Claude Code

With no vote held the CLPC sampled from a deferrable timer, which fires
only when the CPU that armed it wakes for something else. A CPU that went
busy after an idle spell then went unseen: on the M5 Pro (J714sAP) a
pointer chase started 300 ms after the last work ran at DRAM state 0
(300 ns per load) for the whole 60 ms it was measured. Sampling on time
puts the floor in place within 24-32 ms (110 ns). Idle system power reads
6.44 W against 6.40 W, within the SMC's noise.

Other SoCs keep the deferrable timer until it is measured on them.

The T6050 comment also says what macOS's CLPC does instead: it votes from
memory stalls, which this driver doesn't see.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr merged commit 716670b into integration/aurora Nov 11, 2026
7 of 13 checks passed
@RyanTheTide
RyanTheTide deleted the djdev/t6050-clpc-sample-on-time branch November 16, 2026 05:04
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