Skip to content

drm/asahi: G13/G14 host latency paths - #1500

Merged
RyanTheTide merged 5 commits into
integration/aurorafrom
gpu/legacy-inline-publication
Nov 11, 2026
Merged

RyanTheTide merged 5 commits into
integration/aurorafrom
gpu/legacy-inline-publication

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

G13/G14 host latency: publish a ready job from SUBMIT when the queue is idle (the previous logical-queue fence has signalled and the firmware queue is empty; anything else still goes through drm_sched), drain GPU events on a dedicated coalescing receive worker with a capacity hint, and wait on a timeline point's contained fence once all older points are complete. The last commit turns all three on.

gpubench 0dae261, test kernel = fleet58 + these commits, paths off vs on via module parameters, 3 interleaved one-shot boots per arm, us per submission (lower is better):

M1 Pro (J316s)

row off on change
compute.light depth 1 284.4-287.4 141.2-165.1 -47%
compute.light depth 1 round trip 245.3-250.5 114.0-130.9 -50%
compute.light depth 2 73.9-89.4 59.3-60.1 -26%
compute.light depth 4 42.3-45.6 40.5-41.1 -7%
compute.light depth 16 24.6-24.8 23.8-24.4 -2%
render.light tri depth 1 311.3-436.3 231.5-293.4 -27%
render.light tri depth 16 49.6-50.7 48.9-50.0 -1%
sync.signal host 230.5-237.0 190.8-216.8 -13%
compute.light 2 procs 81.3-91.2 57.6-59.2 -33%
render.light tri 2 procs 139.7-165.6 103.6-113.7 -29%
4 procs (compute / render) 42.9-43.9 / 71.9-77.1 43.4-44.1 / 72.7-75.7 flat

M2 (J413)

row off on change
compute.light depth 1 150.7-158.9 127.7-148.9 -11%
compute.light depth 1 round trip 160.5-161.5 122.5-145.3 -17%
render.light tri depth 1 226.0-231.5 214.0-217.4 -6%
idle.wake 2 ms 262.3-263.3 240.4-248.5 -7%
compute.light 2 procs 70.8-76.5 66.3-66.8 -10%
render.light tri 2 procs 122.9-133.1 113.5-116.4 -10%
depth 4 / 16, 4 procs flat

Inline publication alone (M2, 3 boots) gives compute depth 1 -8% and 2-process compute -9%; the full set is better on every row above.

vkQueueSubmit CPU time on the M1 Pro: compute depth 1 50.8-55.5 -> 27.0-35.9 us, render depth 16 21.0-27.6 -> 20.1-21.0 us; it rises at 4 processes (compute 15.6-17.6 -> 33.5-35.3 us) with unchanged throughput.

Gates with the paths on: gpubench-stress-vk --duration 150 --kernel-log 13/13 on two boots each on the M1 Pro and the M2 (queue.depth at 128+64 included), no GPU kernel log lines, Vulkan CTS dEQP-VK.synchronization.signal_order subset (96 cases) on the M1 Pro 0 failures on two boots (24 pass, 72 not supported), glmark2 on the M2 6692/6716/6702 off vs 6675/6755 on.

🤖 Generated with Claude Code

Add default-off early publication for ready, in-order G13/G14
jobs while retaining drm_sched ownership and bookkeeping.

Route legacy GPU doorbells to a preallocated high-priority driver
worker with a scoped utilization clamp. Annotate the fence-signalling
section for lockdep.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
A chain payload is an equivalent wait target once every older
timeline point is signalled.

Add a default-off arm that attaches new waits directly to the
payload. This avoids dma_fence_chain irq_work propagation without
altering the stored timeline.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Require the prior logical queue fence to be complete and each used
firmware queue to have no pending commands before publishing from the
submit ioctl. This keeps dependency-free d1 submissions on the fast path
while deep or cross-engine bursts fall back to drm_sched before they can
move the notifier target past an outstanding job.

Add KUnit coverage for the rejected depth-192 case, serial round trips,
dependency fallback, and the firmware slot/ring boundary.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Turn on inline publication from SUBMIT, the dedicated GPU event receive
worker and the direct wait on ready timeline chain payloads.

gpubench 0dae261, three boots per arm, us per submission (lower is
better), all paths off vs on:

  M1 Pro (J316s)           off           on
  compute.light depth 1    284.4-287.4   141.2-165.1   -47%
  compute.light depth 2     73.9-89.4     59.3-60.1    -26%
  compute.light depth 4     42.3-45.6     40.5-41.1     -7%
  render.light  depth 1    311.3-436.3   231.5-293.4   -27%
  sync.signal host         230.5-237.0   190.8-216.8   -13%
  compute.light 2 procs     81.3-91.2     57.6-59.2    -33%
  render.light  2 procs    139.7-165.6   103.6-113.7   -29%
  depth 16 and 4-process rows unchanged

  M2 (J413)                off           on
  compute.light depth 1    150.7-158.9   127.7-148.9   -11%
  render.light  depth 1    226.0-231.5   214.0-217.4    -6%
  idle.wake 2 ms           262.3-263.3   240.4-248.5    -7%
  compute.light 2 procs     70.8-76.5     66.3-66.8    -10%
  render.light  2 procs    122.9-133.1   113.5-116.4   -10%
  depth 4/16 and 4-process rows unchanged

gpubench-stress-vk (150 s, kernel log checked) passes 13/13 on two boots
per machine with the paths on. The Vulkan CTS synchronization
signal-order subset (96 cases) has no failures on the M1 Pro (24 pass,
72 not supported). glmark2 on the M2 is unchanged (6692-6716 off,
6675-6755 on).

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The module now owns the legacy GPU receive workqueue next to the cleanup
queue; give the G15 probe/init host harness the same stub.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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