Repository navigation
drm/asahi: g17: tie kick-ring views to a render pair's time in a VM - #2520
Conversation
7ddb50c to
d140d08
Compare
d140d08 to
e85fd3f
Compare
|
No blockers.
What I checked: field order drops HW row: one non-M5 G17 Mac (Neo or J616s) running this head: two clients alternating on the render pairs for a few minutes (e.g. vkcube plus a GL client), 0 client faults and 0 GPU recoveries. Also add the regression counts from the M5 Ultra run (0 AVC denials, 0 failed units, 0 new kernel errors). Assisted-by: LLM (Claude:Opus 5.5) |
e85fd3f to
ad9ab51
Compare
|
Thanks, Ryan. Both points are addressed in the commit, now at ad9ab51:
I've added your J775D on this head (stacked with #1973 and our other three open drm/asahi PRs on integration/aurora cc14570, 27.0 firmware, default command line; the kernel also carries a local fix for an appledrm boot oops, see #1973):
Rows we can't run: could your lab, or a Neo or J616s owner, run this head? The change covers every G17 part's render pairs. The useful row is two clients alternating on render pairs for a few minutes with correct renders, the render CTS subset, KUnit pass counts per suite, 0 failed units and 0 new kernel errors. |
|
Re-review of ad9ab51: No blockers.
HW row: the new run is on the M5 Ultra only, on an integration stack with other open PRs and a local appledrm fix. Still needed: one non-M5 G17 Mac (Neo or J616s) on this head, two clients alternating on the render pairs for a few minutes with correct renders, a client closing while its pair is parked, the render CTS subset unchanged, 0 client faults, 0 GPU recoveries, 0 failed units, 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review (§1–§6) on live head ad9ab51fac730065c43bb6b149d7aba0c2f3757d (host-tests: pass).
Checklist Summary
- §1 No model gating: Pass — applies uniformly to all G17 render pairs with zero chip/SoC/board/firmware gates.
- §2 Production-ready, no hacks: Pass — default kernel command line, no new parameters, no sleeps/retries/lab-only paths.
- §3 Safety: Pass — no hardcoded hardware safety constants.
- §4 Clean-room & attribution: Pass — commit
ad9ab51fac73carries human author/committer and humanReported-by/Suggested-by/Signed-off-bytrailers only; PR body includesAssisted-by:. - §6 Naming: Pass.
- §5 Evidence: Holding for non-M5-Ultra G17 hardware proof.
Code Audit (0 blockers)
- Drop ordering verified in
Pair(kick_aliasesandclient_kicksprecedekicks),ParkedPair(client_kicksprecedeskicks), andRetiredBinding(client_kicksprecedesmemoryandcontext). Queue::render()(g17/kick.rs) now requiresOk(Some(alias))to reuse retired ring storage, preventing reuse if a client unexpectedly retains an existing mapping.- Closed-VM view release is complete and race-free:
file::Vm::drop()callsstatus.release_mirror()(markingclient_closed) beforeself.gpu.vm_closed(&self.vm). Already-parked pairs release views one at a time inGpu::vm_closed()outsidestate.lock(); pairs parking afterwards hand views toRetiredBindinginPair::park(); pairs returning from a failed rebuild take closed views understate.lock()ininstall_parked_pair()and drop them after releasing the lock. - Cross-VM rebind (
Pair::prepare_bind/Pair::bind_owner): rings are cleared before preparing the new VM's read-only views, unexpected pre-existing aliases fail withEFAULT, failed rebinds retain the prior VM's views, andbind_ownerdrops the previous VM'sclient_kicksbefore any new kick entry can be written (safe understate.lock()sinceold_contextremains pinned inself.displacedandinstall_memory/drop(moved)already establish thestate -> gpuvmlock order). Commit message and PR body accurately distinguish the parked vs in-place rebind ordering.
Holding For (§5)
0 code/policy/attribution/naming/CI blockers. Holding approval solely for the missing cross-chip G17 hardware row on this head (the J775D run was also stacked with #1973 and other open PRs):
- One non-M5-Ultra G17 Mac (Neo G17P or J616s) on this head: alternating clients on render pairs with verified render output, a client closing while its pair is parked, render CTS subset matching baseline, KUnit pass counts, 0 failed units, and 0 new kernel errors.
Assisted-by: LLM (Gemini 4 Neon)
A render pair's two kick rings are mapped read-only into the VM of the client that runs on the pair. That view was handed to the VM and kept until the VM was closed, so after the pair moved to a queue of another client the previous VM still mapped the rings. A pair rebound in place to a context of another VM was also not cleared first. The views of the kick rings now belong to the pair's time in a VM instead of to the VM. The pair holds them while it runs that VM's contexts and moves between them, and keeps them while it is parked for as long as the VM is open, so a later context of that VM reuses them. Once the client has closed the VM, a parked pair gives them up: when it parks, when it comes back from a failed rebuild, and, for pairs already parked, when the VM is closed. A parked pair therefore never keeps a closed VM's page tables alive. The views are dropped off the device lock. When the pair goes to a context of another VM, the rings are cleared and the new owner's first entry is written only after the previous VM's views are gone. From the parked state, the previous VM's views are removed and the rings cleared before the new VM's views exist. On an in-place rebind, the rings are cleared first, the new VM's views are then created while the previous VM's still exist, and the previous VM's views are removed when the new binding is installed; both are read-only and the cleared rings hold no entries, so neither VM can read the other's. Either way the pair is idle and the firmware consumed every entry; a rebind that fails keeps the previous VM's views. A pair drops its views before its rings, so a ring that is reused never finds an older view of its pages. Reported-by: Erik Bourget <erik@ebourget.net> Suggested-by: Erik Bourget <erik@ebourget.net> Suggested-by: Ryan Murray <ryan@aurorasilicon.org> Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
ad9ab51 to
e562a5c
Compare
|
Thanks. The J775D row is on this PR's own base: integration/aurora 933a43f plus #1973 (the J775D's GPU node and G17D binding), with and without this PR, nothing else. Kits
The head is now e562a5c. It fixes the rustc warning this PR added ( Assisted-by: LLM (Claude:Opus 5.5) |
|
Re-review of e562a5c: no blockers. The only change since ad9ab51 renames The M5 Ultra numbers in the description come from ad9ab51. That head is code-identical apart from this rename, so they hold for this head. Still missing: one non-M5 G17 Mac (Neo or J616s) on e562a5c. The row needs two clients alternating on the render pairs with correct output, a client closing while its pair is parked, the render CTS subset unchanged, and 0 client faults, GPU recoveries, failed units and new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
|
A18 Pro (MacBook Neo, non-M5 G17) row at e562a5c. Kernel: integration/aurora 000ab96 + this PR (and #2199, unrelated), one grub one-shot on the default command line, against the fleet default on the same Mac:
The one failure ( Assisted-by: LLM (Claude:Opus 5.5) |
|
Review notes (non-author): the change looks correct to me (views now live with the pair; the in-place rebind clears the rings and drops the old views; ring reuse takes only a fresh view). Please add a regression test that fails without it (KUnit or a host test over the park / prepare_bind ownership transitions), since the in-place rebind path was not exercised on hardware. Note it conflicts textually with #2501 in |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal pre-PR checklist (§1–§6) re-review at verified live head e562a5c23a96bbb97092a250b12b128ffebcb675 (MERGEABLE CLEAN; live CI: host-tests pass).
Checklist Summary (§1–§6)
- §1 No model gating: Pass — applies uniformly to all G17 render pairs with zero chip, SoC, board, or firmware gates.
- §2 Production-ready, no hacks: Pass — works on the default kernel command line with no new parameters, retries, sleeps, or lab-only paths.
- §3 Safety: Pass — closes cross-VM kick-ring view retention and uncleared in-place rebind; drop ordering (
Pair,ParkedPair,RetiredBinding) and off-lock closed-VM view teardown (Gpu::vm_closed,Pair::park,install_parked_pair) are verified clean. - §4 Clean-room & attribution: Pass — commit
e562a5c23a96carries human author/committer (Jeff Queisser) and humanReported-by/Suggested-by/Signed-off-bytrailers only; PR body includesAssisted-by:. - §5 Evidence: Pass — both affected G17 tiers are now verified on
e562a5c23a96on the default command line:- M5 Ultra (J775D) A/B on this PR's own base (
integration/aurora 933a43ff6d95 + #1973): 1863 alternating client rounds each in 56 s, 0 failures/recoveries/faults, 628-case render CTS subset identical (571 Pass / 57 NotSupported), KUnit 378/380 identical across 77 suites, host tests 461/461, 0 new failed units, 0 new kernel errors. - A18 Pro (MacBook Neo, non-M5 G17) by @RyanTheTide at
e562a5c2: 3 GPU clients for 120 s (805/805 deqp-vk loops + 2 vkcube, 0 faults),kill -9mid-render clean with fresh client recovery, 16,541-case Vulkan CTS smoke identical (8950 Pass / 1 Fail matching fleet default), 0 GPU faults/recoveries/fw crashes/oops.
- M5 Ultra (J775D) A/B on this PR's own base (
- §6 Naming: Pass.
Delta Verification (ad9ab51fac73 → e562a5c23a96)
- Renaming
RetiredBinding::client_kicksto_client_kickseliminates the dead-code warning (0added rustc warnings) while preserving ownership and declaration-order drop beforememoryandcontext.
Non-Blocking Notes
- Adding a KUnit or host regression test covering
park/prepare_bindview transitions (as noted by @RyanTheTide) is welcome as a follow-up. - Merge-train coordination: this PR conflicts textually with
#2501indrivers/gpu/drm/asahi/g17/queue/render.rs; whichever merges second will need a trivial rebase.
Assisted-by: LLM (Gemini 4 Neon)
2ff2a13
into
aurora-silicon:integration/aurora
Problem
A render pair's two kick rings are mapped read-only into the VM of the client that runs on the pair. That view was handed to the VM and kept until the VM was closed, so after the pair moved to a queue of another client the previous VM still mapped the rings. A pair rebound in place to a context of another VM was also not cleared first.
Why this shape
The kick-ring views had their own lifetime, the VM's, beside the pair's binding, which is what decides which VM a pair serves. The two could disagree: after a move or an in-place rebind the binding named the new VM while the views still lived in the previous one. A narrower change would remove the views on the one path that was reported, a parked pair taken by another VM, and leave the in-place rebind and the closed-VM cases as they were. Here the views are held by the binding itself (
Pair,ParkedPair,RetiredBinding), so every path that changes or ends the owner (a move, an in-place rebind, a park, a failed rebuild, the VM's close) drops them by the same rule, and the rings are cleared before a new owner's first entry. Nothing selects by chip: every G17 part's render pairs take the same path.Change
The read-only kick-ring views now belong to the pair's time in a VM, not to the VM.
This applies to the render pairs of every G17 part, with no chip, board or firmware condition. It does not depend on #2501.
Since RyanTheTide's review: a parked pair now drops a closed VM's views (when it parks, after a failed rebuild, and through a new close hook for pairs already parked), and this description and the commit message say when the previous views are removed on each path.
Testing
On the J775D (Mac Studio, M5 Ultra), on this PR's own base: integration/aurora 933a43f plus #1973, which the J775D needs for its GPU node and G17D binding, and nothing else. Kit
pr2520-2is that base with this PR at e562a5c; kitpr2520-2bis the same base without it. One read-only one-shot boot of each through the 27.0 firmware stub, default command line, 0 GPU client failures at boot on both. Aura was main 82ee5d6fdbdf with the commits of aura#262 and aura#264, both merged since.Regression run (ALARM has no SELinux, so there is no AVC count): 0 new failed units (iwd.service and systemd-networkd-persistent-storage.service fail on the read-only test root on both kits) and 0 new kernel error lines: both boots log the same error lines once timestamps and numbers are removed.
Extra evidence, not this PR's own row: the previous head, ad9ab51, on integration/aurora b21dcc6 with #1973 (kits
pr2520-1andpr2520-1b). It differs from this head only in the name of the retired binding's kick-ring field. Longer pair moves ran there: 5593 rounds each in 165 s, 0 failures, against 1917 in 56 s on the base. The CTS subset gave 571/57 on both, and KUnit 375 of 377 in 76 suites on both. Earlier, a run on integration/aurora cc14570 with #1973, our three other open drm/asahi PRs and a local appledrm fix gave the same results (4998 rounds each in 165 s, 0 failures, the same CTS counts). dj's review asked for the own-base run in its place.Still to run
Full test results
On the Mac Studio (M5 Ultra), read-only test root, kits
pr2520-2(integration/aurora 933a43f + #1973 + this PR at e562a5c) andpr2520-2b(the same without this PR), one boot each through the 27.0 firmware stub:apple_g17_rx_util_min_test, which needs CONFIG_UCLAMP_TASK, andj713_accepts_all_loaded_images) on both kits, counted per case from the KTAP lines; per suite identical.tools/asahi/run-host-tests.pyin the build VM: 461 of 461 on integration/aurora 933a43f and on that base with arm64: dts: apple: t6050-j775d: Give the Mac Studio (M5 Ultra) a working GPU, and its M and P core capacities (754/1024) to the scheduler #1973 and this PR; 0 of 461 runs differ.Thanks to ewb for the report and the suggestion, and to RyanTheTide for the review.
Assisted-by: LLM (Claude:Opus 5.5)