Repository navigation
drm/asahi: fail large G17 backing population without direct reclaim - #397
Merged
RyanTheTide merged 2 commits intoOct 23, 2026
Merged
Conversation
The first VM bind pins an entire object. Repeating direct reclaim and compaction for each folio of a large user buffer can leave allocation blocked for minutes under memory pressure. Allow shmem drivers to opt out of direct reclaim before publishing the object, preserving placement and background reclaim. Use the policy for G17 user objects of at least 256 MiB. Kernel objects and smaller resources keep their existing allocation policy. Userspace can release cached objects and retry on ENOMEM. Test successful pinning, a real oversized pin failure and the policy boundaries. KUnit cases run in kernel threads with no return to userspace, so the oversized case flushes deferred fput when it frees its object, releasing the page cache before the next case. It is marked slow. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Append optional device-wide and per-client capacity fields so userspace can expose a heap bounded by the same limits GEM creation enforces. Preserve the existing prefix and bounded writes for older userspace. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This was referenced Oct 23, 2026
Closed
Closed
Closed
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.
On G17 the first VM_BIND of a user object pins all of its backing. For a large object under memory pressure, direct reclaim and compaction run once per folio, and the bind can sit there for minutes. On the Neo a 3.25 GB Vulkan allocation never returned from VM_BIND within 237 s, with the task throttled in memcg high reclaim the whole time.
The first patch lets shmem drivers opt out of direct reclaim before the object is published. Placement and background reclaim are kept, and a pin that can't be satisfied fails with ENOMEM instead. drm/asahi uses it for G17 user objects of 256 MiB or more. Kernel objects and smaller resources keep their current policy, and userspace can drop cached BOs and retry. KUnit covers the GFP mask, a real pin, an oversized pin failing fast and the size boundary.
The second patch appends optional device-wide and per-client capacity fields to GET_PARAMS, so userspace can size its heap from the same limits GEM creation enforces. The existing prefix and bounded writes are unchanged for older userspace.
Results on the Neo
Build and tests on this head
🤖 Generated with Claude Code