Skip to content

soc: apple: clpc: count how often the GPU floor is released and comes back - #263

Merged
chriskearney merged 1 commit into
integration/aurorafrom
neo/t8140-clpc-floor-returns-20261028
Oct 30, 2026
Merged

chriskearney merged 1 commit into
integration/aurorafrom
neo/t8140-clpc-floor-returns-20261028

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to the review of #245: a debugfs count of how often the GPU floor is released and comes back, so flapping is visible.

The GPU floor is released while the PMP limits the DCS, and comes back APPLE_CLPC_GPU_BACKOFF_MS after it last did. The status file showed when the PMP last limited the DCS, but not how often the floor changed. This adds one line to the status file (/sys/kernel/debug/<clpc device name>/status), under the existing gpu: line:

gpu floor releases: <n> returns: <n>

Both are counted at each sample that sees GPU work stream, as the floor goes from held to released and back. Two readings around a sustained heavy run show whether the floor came back while the PMP was still limiting. No behaviour change: the floor decision is the same expression as before, only split so its result can be counted.

Independent of #245 (based on integration/aurora, no overlap with its one-line backoff change).

Testing: W=1 build of drivers/soc/apple/clpc.o with APPLE_PMC and APPLE_CLPC enabled is clean, apart from the existing kernel-doc warning for pmp_agent. check-commits.py is clean. There is no CLPC KUnit suite; reading the counts needs a Neo run.

… back

The GPU floor is released while the PMP limits the DCS and comes back
APPLE_CLPC_GPU_BACKOFF_MS after it last did. The debugfs status shows
when the PMP last limited the DCS, but not how often the floor changed,
so a backoff that is too short, letting the floor flap during sustained
heavy rendering, is not visible.

Count, at each sample that sees GPU work stream, the times the floor
went from held to released and back, and show both counts in the
status file. Two readings around a heavy run then show whether the
floor came back while the PMP was still limiting.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Collaborator Author

CI is green on 8945c4c (plan, self-test, compile, commits, device trees, KUnit, package, boot, host tests): https://github.com/omacom/linux-aurora/actions/runs/40691001142. The same change is aurora-silicon/linux#552.

@DjDeveloperr

Copy link
Copy Markdown
Collaborator Author

Qualified on the Neo (J700): integration/aurora core with this patch and a matching asahi module, Omarchy desktop, debugfs at /sys/kernel/debug/*performance-controller*/status.

point releases returns state
after boot settle 2 2 floor held
after 3 × 30 s render.heavy fill 2160p d4 (TVD0 72 → 107 °C) 10 9 released (PMP limited 39 ms earlier)
after 20 s idle + 2 × 2 s compute.light 46 46 floor back

Under heavy load the counter goes up only while the PMP limits the DCS. The floor comes back once the backoff expires. While the SoC is still hot, the light burst after the heavy leg flips the floor on and off many times (36 cycles), and those cycles are exactly what this counter was added to show. The kernel log has no CLPC errors or warnings. The status file reads without problems while the GPU is busy.

@chriskearney chriskearney left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 8945c4cf22060b38ce0ca1d12adf5d74be380602, the complete one-file delta and current sample/work/reset/debugfs call graph. GPU-floor decisions, error handling, write arguments, backoff and scheduling remain unchanged; counters never feed policy. #245's separate 100 ms timing change is not a dependency or qualified by this review.

Exact-function host controls passed 38,400 old/new sample comparisons and 76,810 checks, with a meaningful missing-counter baseline failure and five compiled semantic mutants caught. These are CPU controls with bounded hardware stubs, not physical PMP executions.

Source/focused-host PASS; no new physical boot is needed for additive diagnostics. The counters describe sampled streaming-policy decisions, not acknowledged hardware transitions, every idle transition or an atomic pair. They persist across halt/resume and wrap as unsigned words. Normal full current-tree MQ remains required; old PR QEMU success is not hardware floor qualification.

@chriskearney
chriskearney added this pull request to the merge queue Oct 30, 2026
Merged via the queue into integration/aurora with commit 6397865 Oct 30, 2026
13 checks passed
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.

2 participants