Skip to content

accel/ane: add scoped PMP levels and bandwidth-vote infrastructure - #684

Merged
RyanTheTide merged 7 commits into
aurora-wipfrom
ane/performance-votes
Oct 31, 2026
Merged

RyanTheTide merged 7 commits into
aurora-wipfrom
ane/performance-votes

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

ANE submission currently raises every CPU cluster's minimum frequency, while H13 ANE clocks stay at their boot policy. This draft replaces that CPU QoS code with workload-scoped T600x PMP level requests and an optional DT/OPP interconnect bandwidth consumer. Level 5 is selected from match data while work is active; requests release after 32 ms idle. Read-only sysfs reports the requested level, requested bandwidth and transition errors.

The PMP provider owns both register windows and serializes ANE_SYS with its existing power-domain users. Existing owners are rejected before DVFS writes. Runtime PM references cover requests and failed rollback; suspend and recovery release requests before gating. The level sequence uses the public dual-licensed omarchy-ane implementation.

This remains draft: T600x has no exported host DCS interconnect provider in this tree. Its GPU firmware receives PMP windows, while the exported PMC voter interface is for a different SoC generation. This patch does not invent a T600x memory-vote transport: memory_vote explicitly reports unsupported until one is supplied. Removing CPU boosting can regress bandwidth-bound programs without that provider, especially on T8103. A verified shared DCS provider and paired M1 Pro latency/power measurements are required before merging. H14 firmware performance control is unchanged.

tools/accel/ane-bench.py collects an installed workload's output, whole-system power and idle recovery. Its access preflight distinguishes EACCES/EPERM from a missing device and names the owning group. Short load captures are marked insufficient for a power comparison.

Validation so far: four native register-model cases, seven provider integration checks, Python byte-compilation and injected permission/missing-device errors pass. All six commits pass strict checkpatch with zero errors, warnings or checks. Four additional removal-path model checks pass, including retaining the report and power-domain attachments after a failed release. Final-head ARM64 objects/DTBs, hardware-free UML KUnit, and binding validation are queued on the build host. Target smoke, paired latency/power and suspend/recovery validation remain outstanding.

Describe the optional shared PMP clock controller and an interconnect
path with OPP bandwidth requirements. Keep controller register ownership
in the PMP provider.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Request the T600x high clock level for work and release it after a short
idle interval. Serialize the PMP request bit with power-domain users,
retain runtime PM references through failed rollback, and release before
suspend or recovery. Replace CPU frequency QoS with an optional
interconnect bandwidth request from DT OPP data. Report unsupported
paths explicitly; this does not supply a T600x DCS transport. Add
register-model KUnit coverage and read-only performance diagnostics.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Describe the ANE DVFS window on the shared PMP report provider and keep
its SRAM powered while the ANE holds a level request. Leave other SoC
layouts untouched.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Capture workload output, whole-system power and idle recovery without
changing driver policy. Identify EACCES and EPERM by device path and
owning group. Mark short load samples as insufficient for a power
comparison.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Do not discard the report node or detach power domains after an idle
release fails during removal. Keep the same conservative retention rule
used for an engine with unknown DMA state, and make the failed teardown
visible. Normal removal releases votes before reclaiming buffers.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The parent Makefile enters drivers/pmdomain only when generic power
domains are enabled. Make that requirement explicit for the standalone
ANE register-model suite so enabling its option actually builds it.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

M1 Pro (T6000, J316s) measurements against this PR, kernel 7.3.0-aurora-fleet12e (no #684 yet), default ANE clock.

Level 5 was not measured. This PR only requests a level when &ane has apple,performance-controller and pmp_report carries the ane-dvfs window, and our ref Macs boot a DTB set from boot.bin that has neither. On those machines the PR would remove the CPU boost and request no level, so they lose the boost and gain nothing until the DT properties reach the boot.bin DTB set. I'd keep that in mind for every machine whose DT predates this series (and T8103, where no level is requested at all).

What the CPU boost is worth today, three single-layer programs, 2000 execs each, two interleaved rounds, boost_idle_ms 100 vs 0:

layer p50 boost on p50 boost off p99 boost on p99 boost off busy on / off (us)
1x1 512->512 @14 123.1 / 123.2 126.4 / 126.5 129.5 / 129.6 135.2 / 136.4 111 / 113
1x1 128->128 @56 110.3 / 107.7 111.0 / 111.7 118.8 / 114.5 117.1 / 137.9 97 / 99
dw 3x3 64 @112 203.5 / 201.4 204.3 / 204.3 208.8 / 207.0 244.5 / 363.7 190 / 195

So on T6000 the boost buys 1 to 3 % at p50 and mostly protects the tail (dw 64 @112 p99 goes from 207 us to 245-364 us without it). Engine busy time barely moves, the difference is submit-side wakeup latency. Removing it here without a level request in its place is a small p50 loss and a real p99 loss.

Whole-system power with the boost on, 40 s loop of the 1x1 128 @56 program (about 8,700 execs/s), was 8.8 W against 4.3 W idle. The boost-off power runs were contaminated by other CPU work on the machine and I'm not quoting them. The ane-bench.py receipt tool from this PR worked fine for the fleet12d baseline (3.29 W idle, 7.57 W under a 1x1 64 loop, 12,271 exec/s).

Suggestion for the draft: keep the CPU QoS path as the fallback when no performance controller is bound (or when the request fails), and drop it only on machines that actually get a level. That avoids a regression on every DT that hasn't picked up the new properties yet.

The PMP report probe now maps an optional ANE DVFS window and
apple_pmp_report_set_state() refuses a reserved ANE domain. The T6030
graph test compiles those bodies verbatim, so it stopped building.

Mirror struct apple_pmp_ane in the fixture and add the platform resource
helpers the probe calls. T6030 reports never name an ane-dvfs window, so
of_property_match_string() reports no match and the resource helpers
assert if they are ever reached.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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