Repository navigation
drm/asahi: g17: do not mark a live owner released when detaching a sibling - #3772
Conversation
…bling Commit f3497c6 ("drm/asahi: fix detached spare ownership and release publication guard") and commit 4fc8d0f ("drm/asahi: g17: keep an owner's wide-layout render pair when reclaiming under QID pressure") detach an idle sibling via State::release_unused_sibling(..., keep_installed=true) by keeping owners[slot] set and marking `released`, so installed render QIDs stay reusable and exit-kill ownership stays synchronized. State::owner_released() checked `(owners[slot] == owner && released)` as a proxy for a closed owner. Detaching one idle sibling from a still-live owner under queue or compute QID pressure therefore made owner_released() return true for that owner, causing try_acquire_render() to skip early publication and acquire_render() to reject subsequent render submissions with -ECANCELED even though the owner remained open on its primary pair. Track detached-from-live-owner slots in a `detached` subset of `released`, exclude `detached` in State::owner_released(), and clear `detached` whenever the slot is reacquired, reclaimed unowned, or converted to a real close in Pool::release_owner() / processor stop. Add KUnit and host-test coverage (plus a mutation guard) verifying that detaching an idle sibling leaves the live owner admissible while closing the owner still cancels further render acquisitions. Fixes: f3497c6 ("drm/asahi: fix detached spare ownership and release publication guard") Closes: #3645 Signed-off-by: Satya Benson <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Note: the |
DjDeveloperr
left a comment
There was a problem hiding this comment.
The state bit distinguishes a reusable detached sibling from a closed owner, and the reuse, release, and reset paths clear it consistently. The new regression test covers admission under pressure and refusal after close. The host failures match the four existing fixture failures. The hardware run includes open PR #3682, so the merge still needs evidence covering this fix independently or the combined candidate once both changes are ready.
|
Merging at |
What: Track idle-sibling detachment (
keep_installed=true) separately from closed-owner release indrivers/gpu/drm/asahi/g17/queue/admission.rssoState::owner_released()no longer treats a still-live owner as closed and rejects subsequent render submissions with-ECANCELEDunder QID pressure. Closes #3645.Tested: M5 Max (
J775c,G17C B1, macOS27.2 (26B123)), kernel7.3.0-1-50-ARCHate3c6ba5fa251(+#3682), Borealis Mesaa4153c8fef, default kernel command line:gpubench-stress-vk --test queue.exhaust10/10 PASS (5 devices x 8 queues, 181 checks, 0 errors each), 0 GPU/DART kernel errors, 0 failed units, HDMI connected, SLC enabled on 32 planes; baseline A/B on the same machine and Mesa (7.3.0-1-46.5-ARCH,e6c7b032+#3686/#3689/#3682) 0/10 PASS (10/10 FAIL) atrender q0 d1, submission 6: pixel (0,0) = cdcdcdcd. Offline:asahiKUnit 513/513 passed (4 skipped),tools/asahi/g17-admission-order-tests.pyPASS (+ 2 mutation guards),checkpatch.pl --strict0/0/0.Risk: two-way door · M5 Macs (G17). Plain revert restores prior admission tracking; change is confined to G17 queue admission and its host test.
Not yet: M5 and M5 Pro (other G17 Macs); non-G17 Macs do not execute
g17/queue/admission.rs.Details
Commits
f3497c695381("drm/asahi: fix detached spare ownership and release publication guard") and4fc8d0f4be14("drm/asahi: g17: keep an owner's wide-layout render pair when reclaiming under QID pressure") detach an idle sibling viaState::release_unused_sibling(..., keep_installed=true)by leavingowners[slot]set while markingreleased, so installed render QIDs stay reusable and exit-kill ownership stays synchronized.However,
State::owner_released()treated(owners[slot] == owner && released)as a proxy for a closed owner. Under queue or compute QID pressure (such asgpubench-stress-vk --test queue.exhaust), detaching one idle sibling from a still-live owner causedowner_released()to returntruefor that owner, makingtry_acquire_render()skip early publication andacquire_render()reject subsequent render submissions with-ECANCELEDeven though the owner remained open on its primary pair.Fix:
detachedsubset ofreleasedinState.detachedslots inState::owner_released().detachedwhenever a slot is reacquired, reclaimed unowned, or converted to a real close inPool::release_owner()/ processor stop.tools/asahi/g17-admission-order-tests.pycoverage (including mutation guards) verifying that detaching an idle sibling leaves the live owner admissible while closing the owner still cancels further render acquisitions.Evidence
Hardware A/B on M5 Max (
J775c,G17C B1, default cmdline, Borealis Mesaa4153c8fef)e3c6ba5fa251(7.3.0-1-50-ARCH, built with#3682for J775c DT/boot):gpubench-stress-vk --test queue.exhaust× 10 consecutive runs: 10/10 PASS5 devices x 8 queues worked; stop: device 6 refused its first work: VK_ERROR_OUT_OF_DEVICE_MEMORY,191 iterations, 181 checks, 0 errors(0.22–0.29 s)5 devices x 8 queues worked; stop: device 6 refused its first work: VK_ERROR_OUT_OF_DEVICE_MEMORY,190 iterations, 181 checks, 0 errors(2.25–2.29 s)0failed systemd units, HDMIconnected,apple-dcpretired boot scanout on swap 4 (5.726 s),apple-mccSLC enabled on 32 planes (5.727 s),0GPU/DART errors indmesg.7.3.0-1-46.5-ARCH,e6c7b032+#3686/#3689/#3682, same machine and Mesaa4153c8fef):gpubench-stress-vk --test queue.exhaust× 10 consecutive runs: 0/10 PASS (10/10 FAIL)render q0 d1, submission 6: render 64x64 ...: pixel (0,0) = cdcdcdcd, expected ff44xx33(154–155 iterations, 144 checks, 1 error).Offline / Host Tests at
e3c6ba5fa251asahiKUnit suite: 513/513 passed (4 skipped)tools/asahi/g17-admission-order-tests.py: PASS (including 2 mutation guards)scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks