Repository navigation
drm/asahi: g17: release pairs, queues and contexts held by stamps that never arrive - #1823
Merged
Merged
Conversation
A render group that retires on its pass record without completion stamps keeps its descriptor slot until stamps cover it (stamps_owed). Its client already has its result, so the group has no drained result. When such a group is still at the front of a pair that gets quarantined, release_witnessed() found no drained result for it and failed with EIO on every event-worker pass once the firmware had drained the pair. The pair never left quarantine, its memory and identities stayed held until the processors stopped, and every pass logged "Could not settle drained render pair N: EIO" (61,445 lines in about two minutes on a J616s under Vulkan CTS). Release a group whose stamps are owed together with the rest of the pair once the pair-wide proof holds: the stamps cover the pair's last publication (and so this group), or the firmware acknowledged the kill of its context. Its descriptor is still never reused before then. quarantine() no longer fails such a group a second time. A closed owner's pair that holds only groups whose stamps are owed is drained the same way: nothing else would ever bring their stamps, and it qualifies for the context kill like other executed, unstamped work. A settlement that still fails is retried with a doubling backoff from 1 ms to 1 s, and after 16 failures the pair stays out of service and is re-checked every 10 s. Each episode logs its first failure with the failing step and the pair's state, and once more when the pair is left out of service. debugfs capacity reports the counts, and KUnit covers the backoff. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
A compute command that retires on its completion record without a completion stamp keeps its descriptor, and its place at the queue front, until the stamp covers it. Once the owner closed, no later command can bring that stamp, and the queue matched neither the exit nor the recycle conditions: its QID and pool backing stayed held until the processors stopped. Make such a queue an exit candidate. The command already finished, so it does not count as a running traversal, and settling the acknowledged kill releases it without reporting it a second time. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
settle_exit() now reads Active::stamps_owed. Add the field to the host-test fixture of the compute queue Active. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
…o compute queue exits A closed context whose render pool leases were all released took the compute-exit branch of the kill selection even when none of its compute queues was an exit candidate, so nothing was killed. A quarantined pair of that context whose last group ran but was never stamped (its pool lease released, waiting for the kill) then kept the context, its scheduler teardown and the pair until the processors stopped. On a J616s under Vulkan CTS this left the closed context in teardown with its render pair quarantined and no render kill published. Take the compute-exit branch only when a compute queue of the context will exit; otherwise consider the render-only kill, which keeps its own conditions (no compute queue still runs the context, never killed twice). Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
List each render pair that is quarantined or still holds work, with what keeps it: owner, groups whose stamps are owed, free-list counters, whether its work ran unstamped, the kill state of its context and the failed settlement count. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
A closed context's kill is not published while other contexts' work runs (kill_unsafe, foreign_compute_running), and the event worker polls closed contexts only for a short window after they close. When the GPU then went idle, no pass looked at the context again, so its kill was never published: its quarantined compute queue and render pair (work that ran but was never stamped) kept their identities and memory, and the next clients ran out of room. On a J616s under Vulkan CTS each such context cost later clients their devices (EBUSY) until reboot. While a closed, unkilled context still has a compute queue to exit or render pairs waiting for a kill, schedule an event pass every 100 ms, so the kill is published as soon as it is safe. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
RyanTheTide
marked this pull request as ready for review
November 13, 2026 23:12
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.
G17: release render pairs and compute queues that hold a group whose completion stamps never arrive.
Render. A group that retires on its pass record without completion stamps keeps its descriptor slot until stamps cover it (
stamps_owed). Its client already has its result, so the group has no drained result. When a pair is quarantined with such a group still at its front,release_witnessed()fails with EIO on every event-worker pass once the firmware has drained the pair. The pair never leaves quarantine and keeps its memory and identities, and the log fills withCould not settle drained render pair N: EIO. On a J616s, Vulkan CTS (timeline_semaphore one_to_n plus op.multi_queue, 4 processes) logged it 61,445 times in about two minutes in 1 of 4 runs. Every client started after that lost its device with EBUSY until reboot.stamps_owedgroup along with the rest of the pair once the pair-wide proof holds. The proof is either stamps covering the pair's last publication (which covers that group too) or the firmware's acknowledged kill of its context. Descriptors are still never reused before then.quarantine()skips groups that were already reported, so they are not failed a second time.stamps_owedgroups is drained the same way. It also qualifies for the existing context kill of executed, unstamped work, because no later group can bring the stamps.aurora-g17/capacityreportsdrained_render_pairs unsettled= failures= recovered= out_of_service=.Compute. A command that retires on its completion record without a stamp keeps its descriptor until the stamp covers it. Once the owner closes, nothing can bring that stamp, and the queue matched neither the exit nor the recycle conditions, so its QID and pool backing stayed held. It is now an exit candidate. The finished command does not count as a running traversal, and settling the acknowledged kill releases it without reporting it a second time.
Kills of closed contexts. A closed context whose render pool leases were all released took the compute-exit branch of the kill selection even when none of its compute queues would exit, so a quarantined pair whose last group ran unstamped was never killed. It now falls back to the render-only kill, which keeps its own conditions. A kill that waits because other contexts' work is running is now re-checked every 100 ms while the context still waits. Before this, once the short window after close ended, no event pass looked at the context again, and its kill was never published. debugfs
capacitylists each render pair that is quarantined or still holds work, along with what is keeping it.KUnit:
asahi_g17_render_drain_retrycovers the backoff. The host-test fixture for the compute exit carries the new field.Test results
J616s (T6040), one-shot kernels on fleet71 (572eb88) config. Vulkan CTS 1.4.7.0, synchronization timeline_semaphore one_to_n + op.multi_queue slice (11,939 cases), 4 processes, 6 runs per kernel. Every kernel below hit the trigger: render timeouts where the fragment stamp of the last group never arrives.
Could not settle drained render pair 18: EIO)With this PR, held pairs are killed and released between runs (
render_kills published=1 acknowledged=1, norender_pairlines,scheduler_teardown pending=0). The 7 EBUSY losses in one run came from kernel lower-VA placement refusals while the runs were busy, which were already present on fleet71 without the trigger. They did not carry over into later runs.🤖 Generated with Claude Code