Repository navigation
drm/asahi: kill G17 contexts left with only executed render work - #508
Merged
DjDeveloperr merged 1 commit intoOct 27, 2026
Merged
Conversation
A closed context whose failed compute command was retired on the firmware's fault record has a clean compute side, yet the render work it queued behind the failure ran without storing its stamp and stays linked in the context's work list. Such a pair is released only after a kill of its context, and that kill was only ever published through one of the context's compute queues, of which none is left to carry it. The context, its pairs and its memory therefore stayed until the GPU firmware stopped: 4 contexts after ten minutes of ray query stress beside heavy geometry. Publish the kill for such a context on its render pairs' behalf. A context qualifies once it has been closed for 250 ms, every pair of it is idle or has executed all of its commands, at least one has, and no compute queue still runs it, switches away from it or has published its kill. The kill names one of the context's own render queues that its scheduler page lists and is refused if the page names a queue of another context; the pairs it holds must have a single admission owner. The rules of a failed context's kill apply unchanged: the pairs are held for the kill, their memory is released only once the scheduler page reports it, the kill waits for a moment without other contexts' compute unless GPU memory is pressed, and the held pairs become killed pairs, reused last, once the context's scheduler release is consumed. The teardown entry keeps the kill's cookie, so only that exact cookie acknowledges it, and its doorbell is retried without duplicating the record. debugfs reports render-only kills, their acknowledgements, the contexts refused by first reason and the kills waiting. On Neo, ten minutes of two ray query stress loops beside heavy geometry had 53 faults, 53 kills through compute queues and 4 render-only kills, all acknowledged, with 0 GPU recoveries and nothing left pending afterwards (4 teardowns before). Ten minutes of the five-lane stress load had 48 faults, 8 kills through compute queues and 2 render-only kills, all acknowledged, with 0 GPU recoveries and nothing left pending. No render-only kill was refused in either run. The asahi_g17_teardown tracepoint records render-only kills as kind 7 and their acknowledgements with queue 0x100.
DjDeveloperr
changed the base branch from
fix/g17-render-quarantine-witness-20261026
to
integration/aurora
October 27, 2026 05:48
This was referenced Oct 27, 2026
Merged
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.
Follow-up to #505 (stacked on it). This closes the case #505 listed as its remaining limit: a closed context whose compute side is clean, but whose render pair holds executed, unstamped work.
The case
In #505 a failed context is killed through its faulted compute queue. Some closed contexts have no such queue. Their failed compute command was already retired on the firmware's fault record (#496), so no compute queue is left to carry a kill, yet their render pair holds work the firmware ran but never stamped. That work is released only by a kill, so the context, its pairs and its memory stayed allocated until the GPU firmware stopped. In #505's two-client ray-query run these were the 4 teardowns left pending.
What this change does
A render-only kill. A closed context qualifies when all of the following hold:
The kill names one of the context's own render queues that its scheduler page lists, never queues 0 and 1.
The rules of drm/asahi: kill faulted G17 contexts before freeing their render work #505 apply unchanged:
Refusals are safe and visible. If the scheduler page names a queue outside the context, if the held pairs have no single owner, or if admission can't hold them, the kill isn't published. The refusal is counted once per context and ends that context's wait. debugfs reports
render_kills published= acknowledged= refused_scope= refused_owner= refused_hold= waiting= longest_wait_ms=.Exact acknowledgement. A render-only kill is acknowledged only by its own cookie, once. The
asahi_g17_teardowntracepoint gains kind 7 (render-only kill published), and kind 4 marks a render-only acknowledgement.Measured effect
Neo (A18 Pro), Mesa agx3.
Two-client ray-query pairs run, 10 minutes (the run where #505 left 4 pending; measured on the first revision of this change, which differed only in how refusals were counted, and none occurred):
Both runs had 4 compute watchdog timeouts between the two traversal clients. That is the long-job contention case #499 addresses, and neither branch includes #499.
Five-lane stress, 10 minutes (render, render2, long ALU, churn and global-priority CTS, plus two ray query geometry-shader loops):
An integration build of the stack without this change left 2 teardowns pending on the same harness.
The churn lane's
concurrent.cr(queues, depth 4) timed out in 18 of 28 runs here, against 11/27 on #505, 10/22 on #496 and 6–12 of 22–28 on other builds of the same harness. The timeouts are not tied to this change's kills. None came within 30 s after a render-only kill (those were at 336 s and 695 s; the closest timeouts were at 280 s, 372 s and 688 s). The rate was the same whether kills were waiting or not: 12/19 with kills waiting, 6/9 without. This test starves when long traversal jobs hold the GPU, which is the contention case #499 addresses.Testing