Repository navigation
drm/asahi: g17: check queue capacity before reserving a slot (no admission spin) - #1146
Merged
Merged
Conversation
Logical-queue creation reserved its admission slot first and only then checked whether a render pair and an execution context were still available. On a refusal it dropped the slot, and that drop notifies the queue-slot domain the creator had observed just before. Its wait in new_queue() (or the retained-context wait) therefore returned at once, so a creator that could not be admitted spun on the device mutex for the whole wait window. On the Neo, eight clients with eight Vulkan queues each logged 2,003,282 LogicalQueues refusals in two seconds while the queues they waited for were being used and closed. Check the queue count, the render pair and the execution context before reserving. A refused creator now holds nothing, so it sleeps until a queue slot is returned or a retained context is reclaimed. Admission limits and the wait window do not change. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Contributor
Author
|
J616s data point on fleet27 (integration/aurora 95e30d5, which does not include this PR), 2026-11-08 05:02 AEDT. A 6-shard dEQP-VK timeline_semaphore run (3834 cases) with the system Mesa logged |
RyanTheTide
added a commit
that referenced
this pull request
Nov 7, 2026
Brings aurora-wip up to the 11-08 morning integration tip: DT descriptions for every Mac family (#1094, #1097, #1111, #1131, #1132, #1148, #1149, #1155, #1156, #1157, #1172), the J616s scaler (#1168), the panel primaries from boot data (#1105), AVD macOS command parity (#1116), AVD dma-coherent (#1169), the M2 PMU RTC alarm (#1151), G17 admission without spinning (#1146) and the AOP map wait (#1147). Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
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 logical-queue creation that has to wait for capacity now sleeps instead of spinning.
Problem
Backend::new()reserved the new queue's admission slot first and then checked whether a render QID pair and an execution context were left. On a refusal it dropped the slot.QueueSlot::drop()notifies the queue-slot availability domain, and the creator had sampled that domain just before. Its wait innew_queue()(and the retained-context wait insideBackend::new()) therefore returned at once, so a creator that could not be admitted re-ran admission under the device mutex for the whole 2 s window.Reproduced on the Neo (J700, G17P), fleet23, system Mesa: 8 processes x 8 VkQueues, each holding its queues for 3 s. The kernel logged
G17 capacity refusal LogicalQueues2,003,282 times in about 2 s. The queues the creators waited for were busy and closing on the same mutex.Fix
Check the queue count (
Pool::has_room()), the render pair (render_fits(open + 1)) and the execution-context count before reserving. A refused creator holds nothing, so it sleeps until a queue slot is returned or a retained context is reclaimed. Admission limits, error codes and the wait window do not change.What this does not fix
The lost device seen by clients over the budget is a separate problem: Mesa creates the kernel queue on first submission, so any capacity refusal becomes
vk_queue_set_lost. The Mesa side reserves the kernel queues atvkCreateDevice: aurora-silicon/mesa#184. The system-wide budget itself (58 execution contexts, fewer once installed compute channels have narrowed the render QID pairs, e.g. 50 on the Neo after 26 compute channels) is unchanged. M1/M2 (G13/G14) have no such limit: 70 concurrent clients pass on the M2.Testing
Neo (J700, G17P), one-shot test kernel 7.3.0-aurora-gpux1 = fleet23 (810b92c) + this commit + linux#1096 + linux#1065. Boot was clean: SELinux enforcing, 0 AVC, 0 failed units, os_uuid pin kept, glmark2 build 6441. Same harness on both kernels: 8 processes x 8 VkQueues, each holding its queues 3 s.
vkCreateDeviceerrors, 0 lostThe refused creators now sleep until a slot returns or the 2 s window ends. Raw logs:
traces/gpu/20261107-g17-queue-capacity,traces/gpu/20261108-gpux1-neo(lab S500). Build: fleet config, LLVM=1, no Rust warnings in the asahi crate.Assisted-by: LLM
🤖 Generated with Claude Code