Skip to content

drm/asahi: g17: report compute admission timeouts; M5: configure a queue's host port before installing it - #1866

Merged
DjDeveloperr merged 2 commits into
integration/aurorafrom
djdev/g17-admission-wait
Nov 14, 2026
Merged

DjDeveloperr merged 2 commits into
integration/aurorafrom
djdev/g17-admission-wait

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • the only kernel line is GPU work of a client failed (EBUSY, reported at g17/runtime/backend.rs:83, …);
  • no recovery, fault or refused submission is logged anywhere on those boots.

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 time in each kind of wait: dependency sources, channel binding, the preparation gate, work state, recovery, shared work ring room, and publication backpressure (which includes the M5 queue installation);
  • the owner's queue state;
  • the recovery state.

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):

change wait bound
this PR compute admission (compute_packet) unchanged: QUEUE_WAIT_NS (30 s) from the publication's start; adds a report when it runs out
linux#1852 render backing (wait_render_retirement) 2 s → QUEUE_WAIT_NS, as for a compute queue
robustness PR (to follow: render publication waits + job watchdog, with the compute recovery extension) render pair/channel/capacity waits, compute admission the recovery extension counts RECOVERY_WAIT_MS from the wait's first sighting of a recovery, capped at the wait's bound + RECOVERY_WAIT_MS

Testing

  • Done:

    • tools/asahi g17 host tests: all 11 pass, including the compute deadline test's 8 negative controls. The CI host-tests job passes on this head.
    • Kernel build: rustc check of the integration tip 17a7c5f + drm/asahi: g17: wait for render backing as long as for a compute queue #1852 + drm/asahi: g17: report compute admission timeouts; M5: configure a queue's host port before installing it #1866 + drm/asahi: mmu: translate an IOVA under the VM reservation alone #1860. 0 rustc errors; the only output is the old kit's 3 known modpost symbol notes.
    • Compile and link of this PR merged onto integration/aurora 96fcb3c, in two configs, both with 0 errors and no warning from this PR's files:
      • Neo kit config: vmlinux, Image and aurora.ko;
      • M5 config: aurora.ko.
    • M5 Pro. dEQP-VK.synchronization* and synchronization2* in full (146,487 cases, 16 jobs) on one slot: stock aurora.ko on the default boot, then this series as a test module on the same kernel. Same Mesa on both arms (aurora-wip tip, no cpuidle: apple: fix T8140 s2idle timekeeping with a selectable WFI state #298).
      • Stock: 86,590 Pass, 59,889 NotSupported, 8 QualityWarning (as always). No GPU kernel lines.
      • This series: 86,588 Pass, 59,889 NotSupported, 8 QualityWarning, plus one client that lost its device, to EBUSY (1 Fail and 1 Crash). No fault or recovery.
      • The new report named the loss: 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).
      • So that loss was a fresh VM waiting 30 s for a compute channel, about 30 s after 16 processes started together. It was not the queue installation that commit 2 changes, and no installation failed in either run.
  • 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

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]>
@DjDeveloperr
DjDeveloperr merged commit a31b32f into integration/aurora Nov 14, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the djdev/g17-admission-wait branch November 16, 2026 05:02
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