Repository navigation
pmdomain: apple: pmp-report: DT-selected CPU memory floor, on by default for T6000 - #2529
Conversation
The PMP report driver raises the DRAM and fabric states for CPU load through the CPU clients' performance request. Describe that floor in the report node instead of selecting it by machine: - apple,cpu-memory-floor lists <request-class level> pairs, the lanes of apple,dvfs-request-levels, so the DT carries each SoC's levels and the driver carries no lane assignment. - apple,pmp-tables names the PMP node whose bootloader-filled tables locate the request entry, for a report that does not otherwise name its PMP. Only the tables are read. Signed-off-by: Ryan Murray <[email protected]>
The demand-driven CPU memory floor ran only on J613: a machine match, a firmware UUID gate and thirteen module parameters selected and tuned it. Make it one floor for every report whose DT node asks for it: - apple,cpu-memory-floor gives the raised request as <request-class level> pairs. J613 asks for the word it always used (class 0x21 at 2, class 0x25 at 4). - The PMP's own tables (apple,pmp-tables, apple,pmp or the PMP that names the report) locate the CPU clients' request entries, as before. - The policy is fixed in the code: raise after two 30 ms samples with a CPU at 80 % or a cluster at 90 % of one CPU (or the GPU at 40 %), release 500 ms after the last demand, at most one transition per 100 ms. While nothing is raised, sampling is deferrable, so an idle system is not woken for it. - On T600x the word goes to every CPU client's entry (E cluster and both P clusters) and no request entry is ever read; the global DVFS state must already be up. On M1 Pro, PACC0 alone brings a P-core pointer chase from ~430 to ~152 ns but leaves the E cluster at ~340 ns; all three clients bring it to ~176 ns. The CPU clients' device power request bits are not acknowledged by this PMP and are not used. - Only a report whose first DVFS-STATE response is known to follow the floor (J613) judges raises and releases from it; elsewhere the floor is published without that check. - A bad floor description costs the floor only, never the report. Every exit path still publishes the valid level 0 before anything else. Signed-off-by: Ryan Murray <[email protected]>
On T6000 the PMP manages the DRAM and fabric states, and CPU load alone leaves them at idle: on M1 Pro a P-core pointer chase measures 423-433 ns and 7-Zip single-thread compression runs at half the macOS rate, until the GPU's request raises the states. Ask the report for the CPU memory floor at the top DRAM (class 0x21, level 3 of 4) and fabric (class 0x25, level 2 of 3) states, with the PMP's tables naming the CPU clients' request entries. Measured on M1 Pro (J316s) with the floor following CPU demand: pointer chase 151-153 ns, 7-Zip 1T compression rating 7100-7241 (4038-4065 without), STREAM 1T triad 58-61 GB/s (30 without); idle power within 0.1 W of no floor, where holding the floor all the time costs 0.29 W. Signed-off-by: Ryan Murray <[email protected]>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed at 1e58938.
- Selection is by DT, not a chip list:
pmp_floor_probe()returns early unless the report node hasapple,cpu-memory-floor(pmp-report.c:2311). The per-SoC difference (all three CPU clients on T600x vs PACC0 plus confirm on J613) comes from the report compatible's match data (floor_all_clients/floor_confirm, pmp-report.c:2347). The oldof_machine_is_compatible("apple,j613")gate, the UUID gate and the module parameters are gone. - What it changes: only the request-class lanes 0x21..0x25 (bits 35:32..51:48) of the CPU clients' SOC-DEV-DVFS request, plus the valid bit. The default level lane (bits 4:0) stays 0 (pmp-floor-gov.h:45). On T6000 that is DRAM and fabric state only. No cpufreq, CPU DVFS or clock policy is touched, so this is DCS/fabric work and in scope.
- Apply and release: raised after 2 x 30 ms samples of demand, released 500 ms after the last demand, at most one transition per 100 ms. With nothing raised, sampling runs on a deferrable work item (pmp-report.c:1740, 2345). Level 0 with the valid bit is published on disable, fault, remove, reboot/shutdown and system suspend (pmp-report.c:2387). Suspend runs in the normal phase, ahead of the PMP's suspend_late, so the PMP still sees the release. I see nothing on the idle or sleep path besides that release.
- T6001/T6002 get nothing, since the property sits under
APPLE_USE_PMPin t6000.dtsi.
Notes, not blocking:
- On T6000 the GPU-demand input is never fed. The only caller of
apple_pmp_floor_gpu_activity()is the M3 (T8122) runtime (drivers/gpu/drm/asahi/m3/agx_host_progress.rs:35). On M1 Pro the floor follows CPU demand only. That is fine, but the PR text lists "the GPU at 40 %" as a trigger. pmp_floor_word_of()checks only that each level fits its 4-bit lane. Your own notes say a 3 in the T6000 0x25 lane reset the SoC. A follow-up that checks the level against the SoC's state count (t6000.dtsi already carriesapple,dcs-state-count = <4>) would turn a bad DT into a refusal instead of a reset.- J613:
pmp_report.j613_floor=0no longer exists, so anyone using it to disable the floor at boot gets an unknown-parameter warning and the floor on. The sysfscpu_memory_floor/enablecovers runtime A/B. The J613 row is still owed post-merge.
CI: host-tests, dt-checks and all six SEP source jobs passed on this head. The Rust change is a symbol rename that matches the header.
|
Post-merge rows: the CPU memory floor also closes the M1 Pro's 16-32 MiB latency band. The M1 Pro (J316s, T6000) ran a pointer-chase sweep from 1 KiB to 256 MiB on a P core, THP, median of 7 reps. The macOS 26.2 column uses the same binary on the same Mac. The kernel is this series, with the same tree as the merged head, plus a lab-only commit that adds the two DT properties, because this Mac's Stage 2 carries its own DTB. I ran the floor governor at its default (on), then with
With the governor on, 16-32 MiB is within 0.97-1.03x of macOS. The same holds for every page-size and placement variant in the kit: 16K pages, scattered 16K, hugetlb 2M and 32M, mTHP, and descending or sequential order. Before this series the band was 2.4-3.8x slower than macOS. So the floor was the whole band; SLC allocation played no part. What is left: DRAM is 1.25-1.32x of macOS (150-154 vs 114-121 ns), and one L2-edge point (11.3 MiB) reads 15.8 vs 7.9 ns. On macOS that point moves to 20.4 ns with scattered pages, so it depends on placement. The Mac stayed silent with the panel off. It was restored to the production kernel afterwards: 0 failed units, 0 AVC. Method and raw data
|
Problem. On T6000 the PMP manages the DRAM and fabric states, and CPU load alone never raises them. On M1 Pro a P-core pointer chase sits at 423-433 ns and 7-Zip single-thread compression runs at half the macOS rate, until something else (the GPU's request) lifts the states. The demand-driven CPU memory floor that fixes this already existed, but only for J613, behind a machine match, a firmware UUID gate and thirteen module parameters.
Change. One CPU memory floor, selected by the report's DT node instead of the machine:
apple,cpu-memory-floorlists<request-class level>pairs (the lanes ofapple,dvfs-request-levels).apple,pmp-tablesnames the PMP node whose bootloader-filled tables locate the CPU clients' request entries. Only the tables are read; it does not touch the PMP's status or start path the wayapple,pmpwould.APPLE_USE_PMP) asks for the top DRAM (class 0x21, level 3 of 4) and fabric (class 0x25, level 2 of 3) states.Testing. M1 Pro (J316s) one-shot boots, N=5, same boot for floor off and governor:
Holding the floor all the time costs 0.29 W at idle (3.11-3.15 W), which is why it follows CPU demand. s2idle 3/3 with the governor running, and the floor works after resume. 0 oops/WARN, 0 AVC. KUnit (qemu arm64, this head): 21/21. The host harness kills all 10 mutants. W=1 and checkpatch are clean, and dtbs build for t6000/t6001/t6002.
Still to run. J613 and T6001/T6002 hardware rows (no lab Mac). The floor reaches users only through a DTB that carries the property. On the packaged boot chain that is the next kernel package's DTBs: they are installed to /boot/dtb, and update-m1n1 rebuilds the Stage 2 image with them. Until then the running DT has no property and the driver does nothing.
Hardware method and protocol findings
T6001 / T6002
The same driver path applies (same report compatible, same table lookup). The property sits in t6000.dtsi under
APPLE_USE_PMP. In this tree only the T6000 boards (J314s, J316s) define that, so the T6001/T6002 DTBs do not carry the property, and their behaviour is unchanged. Not run.Assisted-by: LLM (Claude:Opus 5.5)