Repository navigation
drm/asahi: g17: report compute admission timeouts; M5: configure a queue's host port before installing it - #1866
Merged
Conversation
A compute publication that is still unpublished when its admission budget (QUEUE_WAIT_NS, 30 s) runs out fails with EBUSY, and its client sees a lost device. The kernel reports only the errno and finish_publication's site, not which of compute_packet's waits used up the budget. Under 16 parallel dEQP-VK synchronization processes on an M5 Pro, a device's first compute publication occasionally fails this way. Nothing else was logged on those boots: no recovery, fault or refused submission. compute_packet now times each of its waits by kind: - the firmware sources of the packet's dependencies; - a compute channel binding; - the preparation gate; - a free work state; - a pending recovery; - room on the shared work ring; - publication backpressure, which includes the first installation of an M5 queue. When the budget runs out, a warning gives the time spent in each wait, the owner's queue state and the recovery state. The queue state covers whether it is installed, the item an M5 installation waits for the firmware to consume and the firmware's consumer, an outstanding configuration, and quarantine. The values are read under the device mutex and printed after it is released. Only the first eight such failures per boot are reported. An EBUSY that a wait or the publication returns before the deadline is not reported. The waits, their order, their early returns and the budget are unchanged. The clock is read around each wait. The preparation gate is timed on every pass, so it reads the clock twice even when it does not wait. The compute deadline host test drives the waits with a mocked clock. It checks that each report names the wait the budget went to, and that a cancelled or failed packet, or an early refusal, is not reported. Three new negative controls must fail: reporting every error, reporting without an expired budget, and leaving the publication wait untimed. The other host tests that build Admission now extract the wait kinds too. Signed-off-by: Diljit Singh <[email protected]>
…alling it On M5, a compute publication's doorbell comes with a host-port transaction for its queue: configuration, validity and the advance of its kick. Installing a queue publishes its configuration record and rings the doorbell before the queue's first kick, but it sent the doorbell with no host-port write at all. The queue is neither configured nor valid at the host port when the firmware acts on the installation. A device's first compute publication waits for the firmware to consume that record. Under 16 parallel dEQP-VK synchronization processes, such publications sometimes run out their 30 s admission budget with nothing else logged, and the client loses its device. The missing host-port write may be the cause; that is not shown. The previous commit's report names the wait when that happens. The installation now writes the queue's host-port configuration and validity before its doorbell. It writes no advance, because the queue's ring holds no kick yet, and the first publication configures the queue again with its kick. A publication writes its host-port transaction after its doorbell, the work notification that wakes gated cores. As we understand it, that order matters for the advance the transaction ends with. The installation has no advance, so its configuration goes first. If the host-port write fails, the doorbell still goes out alone, as before, and a warning is logged. Signed-off-by: Diljit Singh <[email protected]>
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.
Two changes for a rare lost device: a compute publication that waits out its whole admission budget.
What happens. Under 16 parallel dEQP-VK synchronization processes on an M5 Pro, a device's first compute publication occasionally waits the full 30 s admission budget (
QUEUE_WAIT_NS) and fails with EBUSY. The client then sees a lost device:GPU work of a client failed (EBUSY, reported at g17/runtime/backend.rs:83, …);It shows up a few seconds into a run, when many processes create devices together, and in mid-run device creations.
1. drm/asahi: g17: report where a timed-out compute publication waited (shared g17 code)
When the budget runs out, compute_packet now reports how it was spent:
The waits, their order and the budget are unchanged. Only the first eight such failures per boot are reported. The compute deadline host test checks the attribution, and three new negative controls must fail.
2. drm/asahi: g17: M5: configure a compute queue's host port before installing it (M5 only)
Installing an M5 compute queue rang its doorbell without any host-port write. The queue was neither configured nor valid at the host port when the firmware acted on it, while every publication writes a host-port transaction for its queue. The installation now writes the queue's configuration and validity before its doorbell, without an advance: no kick is announced yet. Whether this is what ran out the budget is not shown yet; commit 1's report will tell if it happens again.
Related wait bounds (one rule across them; none of them overlap in code):
compute_packet)QUEUE_WAIT_NS(30 s) from the publication's start; adds a report when it runs outwait_render_retirement)QUEUE_WAIT_NS, as for a compute queueRECOVERY_WAIT_MSfrom the wait's first sighting of a recovery, capped at the wait's bound +RECOVERY_WAIT_MSTesting
Done:
compute publication of owner 34 gave up after 30000 ms; ms by wait: sources=0 channel=30000 preparation=0 work state=0 recovery=0 outer room=0 publication=0; queue None; recovery pending false, state Ok(0).After merge: MacBook Neo (G17P), the sync lane's 8-client sync2 load, for commit 1's shared code (logging only on G17P).
🤖 Generated with Claude Code