Repository navigation
drm/asahi: g17: let a refused render take back idle render pools - #1948
Merged
DjDeveloperr merged 1 commit intoNov 15, 2026
Merged
Conversation
Every queue that renders has a render pool whose pages are mapped in an address window that the pools of all clients share; the window has room for about forty pools. A render that finds no room for its queue's pool first asks idle queues to give theirs back, and only then waits: a queue with nothing in flight, whose pool the firmware has released, populates its pool again on its next render. That request never returned a render pool. The reclaim hands the pages it takes back to the caller's batch, which frees them after the device lock is released, and it stops when the batch has no room; both callers passed a batch created without room for render pool pages. Until now a render pool was given back only when its queue was destroyed, or by the event worker after its whole client had been idle and evicted under memory pressure. A client that kept more queues with populated pools than the window holds therefore got no room for one more, although the others were idle: the render waited about 26 seconds and failed, and the client saw a lost device after G17 capacity refusal LowerVa count=... GPU work of a client failed (EBUSY, ...) Give the reclaim of both capacity waits a batch with room for the pools it gives back, and run it only while the window is short: while it refuses a pool, or has no room left for one more. At other times a refusal of other capacity takes no pool back. On M5 nothing changes. More queues rendering at the same time than the window has room for still wait, for up to about 26 seconds, until one has been idle long enough for the firmware to release its pool. Signed-off-by: Diljit Singh <[email protected]>
m0d16l14n1
added a commit
to m0d16l14n1/linux
that referenced
this pull request
Nov 15, 2026
…t-next G17 stability: aurora-silicon#1926 watchdog reason, aurora-silicon#1925 closed-client teardown, aurora-silicon#1946 kept-graph pool pages, aurora-silicon#1948 reclaim idle render pools; configs: aurora-silicon#1938, aurora-silicon#1939 shared defaults.
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.
Every queue that renders has a render pool. The pool's pages are mapped in an address window that the pools of all clients share, and the window has room for about forty pools. When a render finds no room for its queue's pool, the driver is meant to take back the pools of idle queues first (a queue with nothing in flight, whose pool the firmware has released, populates its pool again on its next render) and to wait only if that returns nothing.
That reclaim never returned a render pool. It hands the pages it takes back to the caller's batch, which frees them after the device lock is released, and it stops as soon as the batch has no room. Both callers passed a batch that is created without room for render pool pages. Until now a render pool was given back only when its queue was destroyed, or by the event worker after its whole client had been idle and evicted under memory pressure.
A client that kept more queues with populated pools than the window holds therefore got no room for one more, although the others were idle. Seen with a GL conformance case that keeps many contexts alive in one process, each of which has rendered once: the next context's render waited and failed, and the client saw a lost device after
Change
Limit
More queues rendering at the same time than the window has room for still wait, for up to about 26 seconds, until one has been idle long enough for the firmware to release its pool (about 16 ms after its last render). The queue that waits can belong to any client. Handing pools over between busy queues in turn is a larger change and not part of this one.
Testing
a_reclaim_has_room_for_the_render_pools_it_gives_back). A full kernel build (Image, modules) with KUnit enabled compiles and links with this change; the case itself was not run.tools/asahi/g17-shared-pool-tests.py) now also checks that both callers hand it the batch with room, and only while the window is short. The model part of that test already covered the reclaim with a batch that has room, which is why it did not catch this.dEQP-EGL.functional.multicontext.*,dEQP-EGL.functional.image.render_multiple_contexts.*), limit of eight pools. Old behaviour: the ninth context's render was refused for 24 seconds, then the kernel logged the lost-device line above; no pool was given back. With the change: all 74 cases ran in about two seconds (20 passed, 54 not supported, none failed), the limit was reached 8 times, 67 pools were given back, and the kernel logged no lost-device line.🤖 Generated with Claude Code