Skip to content

drm/asahi: g17: give back the pool pages of kept render graphs - #1946

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/g17-kept-graph-pool-pages
Nov 15, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/g17-kept-graph-pool-pages

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

When a render queue is released while its work list still links work, the driver keeps the queue's render graph allocated until the GPU firmware is stopped, because the firmware may still walk into it. The kept graph also kept its render pool, with all of the pool's pages. Those pages are mapped in the address window that the render pools of all clients share, which has room for about forty pools.

Each kept graph therefore took the room of one pool until the firmware stopped. With enough of them, a new render would find no room for its pool, wait, and fail:

G17 capacity refusal LowerVa count=...
GPU work of a client failed (EBUSY, ...); the client sees a lost device

Graphs are kept after GPU recoveries and failed commands that leave work linked. In normal use of the current driver we have not seen any (none in a four-hour session of conformance runs), so this is a hardening change. It was found while reading the code for a report of the refusal above and is not the cause of that report.

Change

  • The worker's housekeeping pass gives back the pool pages that kept graphs hold, the same way it already does for the pools of evicted idle clients. The pool of a kept graph is never staged again; its pages go back once its final free-list release is consumed.
  • Unchanged: the kept graph itself and the pool's identity stay until the firmware is stopped.

Limit

A kept graph still holds one of the 127 render pool identities and a few hundred KiB. Not leaving work linked at release, so that nothing has to be kept, is a larger change and not part of this one.

Testing

  • A full kernel build (Image, modules) with KUnit enabled compiles and links with this change. No unit test: the path needs live pool and graph objects.
  • MacBook Neo, one boot of a test build with two test-only switches: one restores the old behaviour, one lets a multi-client stress provoke GPU recoveries, so that graphs are kept. With the old behaviour seven kept graphs held seven pools: the shared window's use was 517 MiB. Switching to the change in the same boot brought it to 195 MiB within seconds: a drop of 322 MiB, which is exactly those seven pools. Five more kept graphs with the change on added about 2 MiB in total. A two-client run afterwards, with the stress switch off again, logged no GPU driver line, and neither did the machine's next boot.

🤖 Generated with Claude Code

A render graph stays allocated after its queue is released, until the GPU
firmware is stopped, when the queue's work list still links work. Such a
graph also kept its render pool with all of the pool's pages, mapped in
the address window that every client's pools share. Each one took the
room of a whole pool until then, so repeated failures in one session
could use the window up; new render work would then wait for room and
fail, and the client would see a lost device. This has not been seen in
normal use.

Give those pages back from the worker's housekeeping pass. The pool of a
kept graph is never staged again; its pages go back once its final
free-list release is consumed. The graph and the pool's identity stay as
before.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr merged commit 2dbf9d5 into integration/aurora Nov 15, 2026
1 check passed
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.
@RyanTheTide
RyanTheTide deleted the djdev/g17-kept-graph-pool-pages branch November 16, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant