Repository navigation
pmdomain: apple: restore J613 memory bandwidth with a PACC0 demand floor - #1486
Conversation
Recognize any-core 80% or cluster-sum 90% CPU demand and outstanding GPU work. Debounce raises, hold DCS4/SOC2 through short gaps and rate-limit transitions. Keep request encoding and admission checks independent of MMIO for testing. Carry the R3 aggregate-response release deadline helper: independent demand restarts the quiet interval, and a future publication timestamp cannot underflow the deadline. Signed-off-by: Satya Benson <satya@benson.earth> Assisted-by: LLM
J613 stays at the lowest memory-controller state under Linux load. macOS hypervisor traces 1152/1163 and controlled experiments identify PACC0 as a DCS and SOC floor client. DCS4/SOC2 restores CPU bandwidth from about 21 GB/s to 92-93 GB/s. Admit only validated J613 native PMP tables, discover PTD offsets by range ID and read the request once before owning it. Publish through the update alias and confirm only through DVFS-STATE responses. Drop to valid level zero on disable, suspend, reboot and removal. Count a new raise superseding pending release confirmation, as in the R3 fix. Enable the governor by default through the native J613 report match data, retaining the J613 board check. Disable it for debugging with pmp_report.j613_floor=0 or the existing j613_floor/enable sysfs control. Other machines remain inactive. No diagnostic AGX eligibility vote is included; the R3 independent-vote deadline input is therefore inactive. Register behavior was learned by tracing macOS under the hypervisor on owner hardware, not from Apple source code. Discover the native PMP directly through its report phandle and validate its firmware UUID; no external-display branch is required. Signed-off-by: Satya Benson <satya@benson.earth> Assisted-by: LLM
Exercise request ownership, CPU cluster demand, hold and rate limiting with KUnit and production-header host fixtures. Cover the six R3 aggregate release deadline cases, including concurrent future timestamps. Register negative mutations and update the PMP graph fixture for floor-owner admission. Signed-off-by: Satya Benson <satya@benson.earth> Assisted-by: LLM
8c1cfe4 to
49bae2a
Compare
|
GPT-6.1 Sol on @satchlj's behalf J613/T8122 M3 MacBook Air, firmware 26.6.2/25G83. Tested exact head
AC online throughout both power runs, battery Full/100% at preflight; median battery hwmon power 0 W for idle and load in both modes. These are AC-fed total-system measurements, not unplugged battery-life results. Load repeatedly runs validated 4-thread copy/scale/add/triad, 30M doubles per array, 150 repetitions per invocation; both spans exceed three minutes. Controls/limits were not changed. Native backlight brightness was not fixed and varied during sampling (on 41–166, off 42–168 sysfs units); idle values are observations of the running desktop, not an isolated floor-only power-cost estimate. CPU is median of three runs' best validated copy rates, 15 repetitions; CPU0's separate throughput limitation remains present. GPU subset is identical across modes: 64/256 MiB, scalar/uint4, local256, batch1/64, 448 ordered dispatches, CPU5 submission, two reversed-order rounds. All 16 rows per API per mode validate with zero errors. The table's medians summarize that fixed subset, not a universal GPU ceiling; raw per-configuration comparisons are retained in matched-gpu.csv. GLES elapsed queries are invalid on this stack and are rejected, so no GLES engine-time result or GLES/Vulkan engine parity is claimed. Vulkan timestamps are usable. Existing completed on CPU/GPU receipts were reused; off CPU/GLES/Vulkan were rerun fully, and fresh three-minute power runs were made in both modes. Internal keyboard/trackpad are absent on pure integration/aurora without PR971. MTP is unbound and dockchannel-HID deferred in these pure PR1486 boots. The floor commits do not modify DART, RTKit helper, MTP, dockchannel-HID or the input path (complete ten-file source-scope receipt retained). Today's separate exact-PR971 sitting restored physical input; this floor test deliberately added no PR971. Wi-Fi/internal eDP and GPU compute validation were observed. No fatal GPU/kernel fault was found in the completed floor runs. Human input, audio output, camera, external display, actual suspend/resume, macOS, and long uptime were not tested here. No external display or Thunderbolt cable was attached. Stage1/2 and masked package hooks were untouched. Trials used the approved one-shot tool; default boot and cleanup were verified before closing this result. |
|
GPT-6.1 Sol on @satchlj's behalf Controlled power follow-up on the same exact J613 PR1486 head
Idle order on/off/on/off, each 305.6 s after settling, 306 observations each; paired on-minus-off differences -0.008, -0.009 W. SD describes sample variation, not independent-sample confidence or instrument accuracy. Each loaded job ran on/off/off/on; table averages two repetitions per mode. Joules integrate total-system power across the whole process, including setup/warmup/validation; no idle subtraction. Copy bytes count read + write. The mixed job uses the same immutable The floor reduced memory-copy energy per GB with no resolved idle increase, but it also engaged during pure computation, where mean job energy was about 3% higher. |
|
GPT-6.1 Sol on @satchlj's behalf 2026-11-10 J613 re-test with #1486 head 49bae2a. Floor admitted=1 enabled=1 faulted=0; 25 raises/25 drops confirmed, zero unconfirmed and zero superseded. Held word/state 0x2004000200000000/0x3224; released 0x2000000000000000/0x3200. Four-thread CPU copy best 91.592/91.505/91.439 GB/s, zero errors. GLES copy host up to 72.400 GB/s (GPU timer unavailable); Vulkan copy host up to 94.884, GPU up to 95.487 GB/s, zero errors. Freezer/devices/platform diagnostics returned; no actual sleep-power test. The retained command line explicitly sets pmp_report.j613_floor=1; this is not a parameter-omission/default-on boot test. J613/T8122 M3 Air, integration dc8f6f7 plus #971/#973/#974/#978/#1340/#1486/#1491, composed source 112007b70271. Hardware-tested release 7.3.0-aurora73-upstream-2-ARCH; UKI SHA256 248283ad7750793cf60f8530e3e2331f7c1a58d733d2f3e8880f8a959e87becc. Composition evidence, not an isolated PR kernel. The same binary passed a one-shot trial and the normal new-default reboot. Installed package revision 30.10 corrects only the installer's pre-extraction space estimate; all 2054 Linux-package usr regular files match the qualified 30.9 package. Stage1/Stage2 unchanged, four boot hooks masked. |
|
GPT-6.1 Sol on @satchlj's behalf The description's one slow P core / low CPU0 IPC caveat is now explained by Linux supplier synchronisation gating the unclaimed T8122 |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.
P2: Protect cpufreq policy lifetime in the sampling worker before merging. j613_floor_sample() runs under f->lock only, obtains cpufreq_cpu_get_raw(cpu), then dereferences policy->related_cpus. That raw getter does not take a reference, while cpufreq policy teardown clears the per-CPU pointers and frees the policy masks. f->lock does not serialize that teardown, so an already obtained pointer can become invalid. Use referenced policy access and appropriate policy/hotplug synchronization; validate policy teardown/hotplug while governor sampling continues.
The same head's cpufreq core documents cpufreq_cpu_get()/cpufreq_cpu_put() as the referenced API. This is a source-level lifetime finding, not a reproduced hardware crash. Existing exact-head performance/default-on/on-off and controlled power evidence is substantial; I am not asking to repeat already-completed power measurements. After the fix, test governor disable/re-enable, teardown and suspend/release on the new head.
| (wall - f->cpu_wall[cpu]) * NSEC_PER_USEC <= 10 * period) { | ||
| unsigned int pct = pmp_floor_cpu_pct(f->cpu_idle[cpu], f->cpu_wall[cpu], | ||
| idle, wall); | ||
| struct cpufreq_policy *pol = cpufreq_cpu_get_raw(cpu); |
There was a problem hiding this comment.
P2: cpufreq_cpu_get_raw() leaves this workqueue with an unreferenced policy. The subsequent related_cpus dereference can race policy teardown; f->lock protects only the floor owner. Use referenced policy access and suitable synchronization, with teardown/hotplug coverage.
Hold the CPU hotplug read lock across counter sampling and take a policy reference only while reading related_cpus. Reset offline CPU baselines so re-online cannot manufacture demand. Exercise absent and removed policies and re-online sampling with the production CPU sampler on the host. Assisted-by: Codex:gpt-6.1-sol Signed-off-by: Satya Benson <satya@benson.earth>
|
GPT-6.1 Sol on @satchlj's behalf Fixed the sampling lifetime in The host test executes the production CPU sampler with an absent policy, removal after referenced lookup, balanced get/put checks at mask access, and offline/re-online baseline coverage. Offline validation passed on arm64 neo-build: PMP host suite 21/21 (including all ten floor mutation controls); an arm64 KUnit Image with APPLE_PMP_REPORT and CPU_FREQ enabled built with Clang 18; QEMU passed 34/34 tests, including all six pmp-j613-floor-gov cases. The public head has the exact tested source-tree hash. Current integration 7cb581e was merged without rewriting the original branch; its full host suite passed 224/224, including the eight inherited host failures. Local toolchains were Python 3.12 / Rust 1.99 / GCC 13 / Clang 18; CI's x86_64/Python/Rust pins were not reproduced locally. Not tested: no new on-device run, power measurement, boot, unload, or suspend experiment. To follow from hardware on this new head: governor disable/re-enable via the sysfs control and the boot parameter, module teardown, suspend/release, plus CPU offline/online under load and policy removal/reappearance while sampling. The ready hardware procedure is recorded in machines/m3-air/research/2026-11-11-pr-review-round/PR1486-ONDEVICE.md in the notes repo. APPLE_PMP_REPORT is currently bool and suppresses manual bind/unbind; actual removal needs an instrumented test build, and is not claimed here. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.
The P2 cpufreq-policy lifetime finding is resolved in source. Fix868e7dee, retained by merge head98e4d336, holds cpus_read_lock() across online-mask and counter sampling, obtains a referenced policy only for related_cpus, copies the cluster key before the balanced put, and retains no policy pointer. Cpufreq teardown waits for those references before freeing masks. Both callers are sleepable workers; no new reverse lock path was found. Clearing offline baselines correctly primes re-online samples. The production-function test meaningfully checks lock/reference state, absent/unpublished policy and baseline reset.
The remaining merge hold is qualification of this default-on J613 governor, not the old raw-pointer bug. The author reports offline PMP21/21, arm64 build/QEMU34/34 and local host224/224, but explicitly has no new on-device result for this head: disable/re-enable and boot veto, suspend/release, CPU offline/online and policy-lifetime behavior remain unqualified. Actual removal needs an instrumented build because APPLE_PMP_REPORT is bool and manual unbind is suppressed; an unload result is not claimed. Sustained-load power is also still unmeasured. Current hosted CI43052589377 is queued and is not replaced by the local toolchain report.
Keep this unmerged until the already-described qualification is supplied or the default-on rollout is narrowed to a separately qualified scope. No new M3 test, machine access or power-policy change is being requested or scheduled by this thread.
|
GPT-6.1 Sol on @satchlj's behalf Exact PR head tested: Unattended J613/T8122, firmware 26.6.2. Kernel Substantive checks passed:
The unchanged runbook's final whole-dmesg grep exits 1 for runtime/suspend/runtime-repeat because it matches this warning, also present on the captured 30.12 baseline: No new matching kernel fault signature was found versus baseline; this is not claimed as an entirely green script exit. Not run: actual CPU hotplug (no per-CPU online controls under the installed spin-table Stage 2), PMP module unload (APPLE_PMP_REPORT=y; teardown mode explicitly reports UNTESTED), KASAN/lockdep (not configured). The normal cpufreq policy teardown above is distinct from PMP-driver removal. No fresh power measurement. Left on default package 30.12/support 30.122, no trial/one-shot, zero failed units; lease released. |
|
GPT-6.1 Sol on @satchlj's behalf Additional unattended J613 follow-up on PR head CPU hotplug limitation is now traced precisely, rather than inferred from a glob: live
Four P-core workers pinned to 0/5/6/7 continuously call libc memmove on separate 256 MiB sources and destinations, outside cache capacity. Buffers initialize before timing; completed copies count read+write bytes, and all four workers in each mode pass page-spaced destination validation. SMC Total System Power sampled approximately every 0.5 s, trapezoidal integration, no idle subtraction. Single on→off sequence, 30 s mode settling; not randomized or thermally equilibrated. This is a new sustained-copy implementation, not a rerun of the earlier fixed-work assembly benchmark. No compilation required. Thermal limiting was real with the floor on: P cooling state 8/19 and P max cap 3.288 GHz captured; sampled P frequency readbacks span 2.808–4.056 GHz. With floor off, captured cooling states are zero, P max cap 4.056 GHz, and readbacks 3.960–4.056 GHz. Thus the sustained numbers include the fanless machine's thermal response. Floor was raised in all 1185 on samples, absent in all 1183 off samples; faulted=0 throughout. Off request word Power-condition limitation: AC-online remained 1, but the existing supply advertises only a 2.375 W input limit. Battery contributed power and declined 87→83%; configured charge thresholds 75/80 were preserved. This does not complete the requested adequate-AC/near-full-battery qualification. SMC system watts above are measured system consumption, not adapter input or battery-only power. Not run in this follow-up: CPU hotplug/last-CPU cycles (unavailable), built-in PMP removal (no instrumented build), KASAN/lockdep (disabled), another boot-off/suspend/policy-teardown campaign (previous exact-head results remain separate), or adequate-supply near-full steady-state qualification. No claim that these measurements clear all merge holds. Returned to default 30.12 |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.
The remaining substantive qualification hold is now addressed on98e4d336. This approval supersedes my prior CHANGES_REQUESTED review5861646287; the original cpufreq lifetime finding remains fixed and is not reopened.
The owner’s exact-feature-head combined J613 reports now cover omitted-parameter default-on and explicit boot veto, repeated loaded runtime disable/re-enable, RTC s2idle valid-zero floor release/resume, and normal cpufreq module removal/reload while the sampler observes absent policies. The 600s-per-mode sustained-copy report adds valid SMC system-power, bandwidth and thermal evidence, with functioning thermal caps and faulted=0. The unchanged baseline wireless-extensions warning causes the runbook’s final grep to fail; this is not relabeled as an entirely green script exit.
Independent source reassessment confirms balanced referenced policy access under the hotplug lock, offline baseline priming, GPU publication clearing before synchronous work cancellation, and devres stop ordering before allocation/MMIO cleanup. The governor policy header is byte-identical to earlier hardware-qualified49bae2a; vote thresholds, defaults, clamps and power-limit behavior did not change with the sampling lifetime fix. No remaining material unsafe lifetime/default-on edge was found. Current hosted host-tests pass.
Physical CPU hotplug is unavailable on this spin-table path, and builtin/manual-unbind restrictions prevent a normal PMP unload experiment. Instrumented device removal, KASAN/lockdep and adequate-supply/near-full steady-state testing remain uncompleted coverage limits, not claimed passes. The power record is battery-assisted total-system consumption, not adapter input or battery-only power. Neither earlier public review required repeating the older controlled-power qualification under that specific charger condition; no newly invented precondition or new M3 experiment is requested.
This supports the intended J613 source merge while retaining those limitations. It does not qualify other boards, every boot method or broad sleep stress, and author reports remain attributed. No source/default change, build, machine access, new test, recording or loader/boot-policy operation was performed for this reassessment.
254c9bd
into
aurora-silicon:integration/aurora
Qualification update on
98e4d336787e70c86d73d09d6d5a8fef86a83f6d: the owner’s later reports now cover default-on/boot veto, repeated loaded runtime toggles, suspend floor release/resume and normal cpufreq-policy removal/reappearance. A 600s-per-mode follow-up records sustained system power, validated bandwidth and functioning thermal limiting. These reports include this exact feature head in a combined J613 kernel; they are not isolated-PR qualification. The earlier statements below that no exact-head sustained measurements exist are superseded by comments6804319345 and6806427775.Explicit limits remain: physical CPU hotplug is unavailable on the installed spin-table boot path; instrumented PMP device removal, KASAN/lockdep and adequate-supply/near-full steady-state testing were not completed. The new SMC data measures battery-assisted total-system consumption, not adapter input or battery-only power; the on→off trial is not randomized or thermally equilibrated. The whole-script diagnostic grep still exits nonzero on an unchanged baseline wireless-extensions warning, so no entirely green script exit is claimed. No new hardware action is requested by this update.
On J613 (M3 MacBook Air, T8122), the memory controller stays at its low DCS/SOC state under CPU and GPU load, limiting copy bandwidth to about 21 GB/s.
This series adds a demand-driven PACC0 memory-floor governor, on by default for J613 and off on every other board. Enablement comes from the existing native J613 PMP report's compatible match data, with an additional J613 board check, T8122 supplier/firmware UUID validation and native-table admission. No global Kconfig default or DT/binding change is needed. Disable at boot with
pmp_report.j613_floor=0, or at runtime by writing0to the report device'sj613_floor/enablesysfs attribute.The governor requests DCS4/SOC2 only under demand: any core at least 80% busy, a cluster's summed busy time at least 90% of one CPU, or outstanding GPU work at least 40%. It samples every 30 ms; two demand samples raise the floor, with a 500 ms hold and 100 ms minimum transition interval. It returns to valid floor zero after demand subsides. Disable, fault, suspend, remove and shutdown withdraw the floor. Requests are read once before ownership and never echoed after stores; confirmation uses DVFS-STATE responses.
Three commits provide policy, driver integration and tests, directly on
integration/auroradc8f6f7, which remains current and merges cleanly. No unmerged dependency, diagnostic AGX eligibility vote, display, RTC or CPU0 tuning changes.Measurements and remaining qualification
Retained November 9–10 owner measurements justify enabling the demand-driven floor on J613:
Power under sustained load with the floor engaged has not been measured separately. A hardware result on this exact head will follow. This update uses offline checks only. Other boards have not been hardware-tested and cannot acquire a floor owner, even with the parameter enabled.
The Linux GPU runs used 7.3.0-aurora73-rebase-2-ARCH (integration/aurora c880586 plus retained J613 enablement and R3 fixes), with AGX eligibility voting disabled. CPU0's unresolved low IPC remains outside this series.
Validation
--ignore FILE_PATH_CHANGES(generic new-file MAINTAINERS reminders excluded);git diff --checkpasses. HumanSigned-off-byandAssisted-by: LLMtrailers are retained.dtbs_check: not applicable; no DT/binding files changed. DTBs build successfully.Provenance
Register behavior was learned by tracing macOS under the hypervisor on the owner's hardware (HV traces 1152/1163), not by reading Apple code. The series contains Linux implementation and synthetic tests, with no copied Apple source, firmware, trace dumps, private paths or hostnames. R3 shared-release deadline handling is included; its independent AGX-vote input remains inactive because that diagnostic client is excluded.
AI attribution follows
Documentation/process/coding-assistants.rst:Assisted-by: LLM, with the human DCO sign-off. This default-on revision was implemented with Codex (GPT-6.1 Sol); the original series was prepared with Claude Code.