Skip to content

drm/asahi: g17: M5: read the compute item-ring cursors once per publication - #1401

Merged
DjDeveloperr merged 1 commit into
funkzy/t6050-gpu-on-integrationfrom
dj/g17-m5-compute-cursor-snapshot
Nov 10, 2026
Merged

DjDeveloperr merged 1 commit into
funkzy/t6050-gpu-on-integrationfrom
dj/g17-m5-compute-cursor-snapshot

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

At depth, M5 compute submissions are bound by the submitting thread's own CPU time. gpubench compute.light at depth 16 runs at exactly its submit_cpu_us. About 10 µs of each submission runs under the device mutex g17::Shared::state, in compute_inline → publish_with_native_waits.

A per-site timing build of the driver (measurement only, not part of this PR) split that hold. Among its stages, each item-ring cursors() call is three loads from shared GPU memory, and one publication made up to four such calls:

  • the room check;
  • ensure_record_slot;
  • the reclaim of consumed items;
  • the producer it appends at.

The producer is the host's, and only this publication, under the device mutex, moves it. The firmware's consumer only advances. So one snapshot taken at the room check serves the rest, and an earlier consumer value is conservative for all three checks: room looks smaller, record-slot reuse waits longer, and the reclaim leaves the rest to the next publication. Non-M5 paths are unchanged.

Measured on the M5 Pro (J714s)

Integration Image with this lane's build of the driver, with and without this commit (only aurora.ko differs). gpubench is pinned to CPU 12, one of the faster 0x065 cores. The boots are interleaved, base and this commit three times each. µs per submit:

test base (3 boots) this commit (3 boots) change
compute.light d4 43.8 / 42.7 / 42.2 38.6 / 32.7 / 34.4 −19%
compute.light d16 20.4 / 20.5 / 19.7 17.5 / 17.3 / 17.4 −15%
compute.light d64 20.6 / 19.3 / 19.1 16.9 / 17.3 / 17.3 −10%
render.light tri d16 35.2 / 36.5 / 31.9 33.8 / 31.9 / 31.6 −9% (overlapping)
render.light tri d64 36.2 / 37.1 / 32.1 33.6 / 32.1 / 31.7 −11% (overlapping)

The submit's own CPU time at d16 goes from 18.0 to 14.9 µs. compute.light d1 (157 µs) and the cross-queue hop are unchanged.

dEQP-VK samples with this commit:

sample Pass NotSupported Fail
s0 109 2 0
compute 223 791 0
glsl 1209 130 0
draw 906 74 0
texture 660 251 0
synchronization 693 389 0
synchronization2 600 421 0
synchronization2 multi_queue.timeline (mq-tl) 214 0 0
synchronization2 multi_queue (mq-all) 290 106 0
synchronization multi_queue (mq-v1) 427 0 0
query_pool occlusion (oq-all) 440 7 0

gpubench core-a and feat: 41/41. No GPU recoveries or timeouts during the run.

queue/compute.rs is identical on this branch's head (0dd0833) and on the tested base, so this is the tested diff. It applies with no conflicts and was not rebuilt.

🤖 Generated with Claude Code

…cation

An M5 compute publication read the item-ring cursors from shared GPU
memory up to four times under the device mutex, three uncached loads
each: for the room check, the record-slot check, the reclaim of consumed
items and the producer it appends at. The producer is the host's and
only this publication moves it; the firmware's consumer only advances.
One snapshot taken at the room check therefore serves the rest, and a
consumer read earlier is conservative for all three checks.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr force-pushed the dj/g17-m5-compute-cursor-snapshot branch from 9fda430 to 1ddc0f5 Compare November 10, 2026 09:11
@DjDeveloperr
DjDeveloperr changed the base branch from funkzy/t6050-gpu-on-integration to dj/g17-restart-storm-progress November 10, 2026 09:11
@DjDeveloperr
DjDeveloperr changed the base branch from dj/g17-restart-storm-progress to funkzy/t6050-gpu-on-integration November 10, 2026 10:21
@DjDeveloperr
DjDeveloperr merged commit f2342f5 into funkzy/t6050-gpu-on-integration Nov 10, 2026
fbalazsy pushed a commit to fbalazsy/linux that referenced this pull request Nov 11, 2026
The item-ring snapshot that aurora-silicon#1401 takes for an M5 compute publication
served its room, record-slot and reclaim checks, but both appends (the
configuration and its notification) still read the ring cursors again:
three uncached loads each under the device mutex. The same argument
covers them: the producer is the host's and only this publication moves
it, and the firmware's consumer only advances, so the snapshot's
consumer is conservative. The room check already required space for
both items. Append against the snapshot, with the producer the
publication has reached.

Signed-off-by: Diljit Singh <[email protected]>
@RyanTheTide
RyanTheTide deleted the dj/g17-m5-compute-cursor-snapshot 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