Repository navigation
drm/asahi: recycle settled quarantined G17 compute queues - #305
Merged
Merged
Conversation
A failed client's compute queue is quarantined. Once its owner closes and the retirement witness has settled every retained command, the queue has no active command, so exit_candidate() never issues a kill for it, and reusable() refuses it because it is still quarantined. It therefore keeps its QID and its USC pool backing until the processor stops. Each Gen1-capable compute pool takes about 43 MiB of the T8140 dynamic lower VA window. On Neo, after roughly 42 failed clients the window is exhausted and every new compute submission fails with ENOSPC until reboot. Return such a queue to service the way recycle_killed() already does after an acknowledged kill: reset the item ring at the firmware consumer cursor and require fresh backing, so the existing vacate path publishes the free-list release and frees the VA. A kill acknowledged before the scheduler page showed the killed state was left Unproven forever, retaining its queue as well. Re-read such kills on later passes and settle them only once the page shows the killed state, also when their commands were retired by other means. Validation on Neo with deliberately failing compute clients: unmodified aurora-wip reaches ENOSPC after about 42 failed clients. With this change, a fresh boot handled 84 failed clients, including a replay of 28 failed device creations, with no ENOSPC and no firmware crash, and the same build passed more than 150 failed clients on one boot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every failed GPU client on Neo (T8140) leaks its compute queue. A failed client's queue is quarantined, and once the owner closes and its commands are settled nothing returns the queue to service:
exit_candidate()needs active commands, andreusable()refuses quarantined queues. The queue keeps its QID and its ~43 MiB USC pool backing until the processor stops.After about 42 failed clients the T8140 dynamic lower VA window is full. From then on every new compute submission, from any app, fails with ENOSPC until reboot.
Fix
Queue::recycle_quarantined_idle()returns a settled, ownerless quarantined queue to service through the same pathrecycle_killed()already uses after an acknowledged kill. That path resets the item ring at the firmware consumer cursor and requires fresh backing, so the existing vacate path releases the pool and its VA.settle_exit()re-reads kills leftUnproven, meaning the kill was acknowledged before the scheduler page showed it. Such a kill now settles only once the page shows the killed state, even if its commands were retired by other means. Before this change those queues were also retained forever.The change touches 3 files (+37/−3) and has no new options or debug flags.
Hardware validation (Neo, A18 Pro)
Failures were generated with deliberately failing compute clients.
aurora-wip5f6c917The committed files are byte-identical to the module source that was tested.
Known issues (pre-existing, not changed here)
fail_after_observation()settles that frame as abandoned with EIO, and the victim's VM is marked lost. On Neo this kills Hyprland's GPU context, leaving a frozen or blank desktop. It happens with and without this commit; the render path is untouched here. A fix is in progress.🤖 Generated with Claude Code