Repository navigation
drm/asahi: g16: map the compute notifier records ASC-cached - #3285
Conversation
The firmware reads and updates a compute queue's notifier record around every finished command: the post-callback inserts the command, bumps its count and stores its context, and the notifier walk reads the record again before it stores the command's service stamp. It cleans and invalidates the record itself. macOS 26B123 maps these records ASC-cached (seen in a hypervisor dump of a live Metal compute queue on the J773g) and keeps the service stamps in separate uncached cells. G16 mapped the whole compute notifier page uncached, so every finished command paid for some 40 uncached firmware accesses. Map the compute notifier page ASC-cached. The host writes it only before the firmware first sees it. Move the compute service stamp from that page to the queue's own uncached user-stamp cell, which the host reads for completions. Drop the read of the record's context word from the compute receipt: the firmware writes that word back only when it unlinks the record, so the host cannot read it reliably, and the service stamp already authenticates the receipt. Its target is the pipe's own ordinal, and the firmware stores it only after its last access to the command's work item, microsequence and UMA descriptor. Render notifier records are unchanged. Signed-off-by: DjDeveloperr <[email protected]>
|
J516s (M3 Pro, G15S) row at |
|
Verdict at Blockers: none Checked:
Evidence
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J516s (MacBook Pro 16" M3 Pro, G15S) row at
|
There was a problem hiding this comment.
Verdict: MERGE at 32e089fe
Blockers: none.
Checked:
drivers/gpu/drm/asahi/g16/graph.rs,engine.rs,fw/graph.rs,poll.rs: verified only the compute notifier page changes toClass::FwCached(render notifier, thresholds, anduser_stampremain uncached), computeuser_stampmoves tog.user_stamp.va(Class::Shared), andpoll.rsauthenticates compute receipts viag.user_stampwithout reading stale cachedCOMPUTE_CONTEXT.test-resources.pyandtest-stamp-wrap.py: verified updated resource class and receipt expectations.- Verified 22/22 CI green and hardware rows on both J773g (M4 mini: ABBA +5.5..+7.9% compute, 202/202 gpubench 84/84 CRCs, 99k CTS) and J516s (M3 Pro, G15S: exact head
32e089fecee2, 3.47M jobs, 0 faults).
Evidence
- Diff reviewed at
32e089fe(all 6 files, 189 lines). - CI: 22/22 PASS.
|
Merge-train status at |
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
Forward-merge main after #3285. Only the asahi-m4 selftests conflicted: test-resources.py takes main's Registry::release(file, process) and LiveToken process field in the new test_live_token() helper; test-stamp-wrap.py keeps the PR's pub manager/fw::graph alias and adds main's user_stamp cell, and the shared compute UMA test now marks pipe 1 done through user_stamp like the other compute cases on main. Signed-off-by: Ryan Murray <[email protected]>
What: on the M4 (G16G, 26B123 firmware), map the compute notifier records ASC-cached, as macOS does.
The firmware reads and updates a compute queue's notifier record around every finished command. G16 mapped the compute notifier page uncached, so each command paid for about 40 uncached firmware loads and stores.
Tested: J773g (M4 Mac mini) and J516s (M3 Pro). The current head
32e089fecee2merges main9e38a276dcb4into the tested branch without conflicts. The notifier change remains commit761bc4168404.b14959b819cfvs this change, both native warm builds on the J773g. The measured kit ise9873471e1bc; the tested PR commit761bc4168404adds only a host selftest fix and has the samedrivers/tree as the kit.15c5bb524162, gpubench-vk 13.Both arms: 202/202 ok, 84/84 CRCs correct.
vs Metal 4: main 1.200× geomean (130/202 rows faster), fix 1.198× (129/202). Fix vs main is 0.994×, within single-run noise.
Every row that read 5 % or more worse in the single runs was rechecked with 3 interleaved passes per arm:
The query-overhead rows are differences of two ~100 µs numbers. In absolute terms the fix is faster both with and without queries.
dEQP-VK.synchronization2.cross_instance.suballocated.write_ssbo_vertex_read_ssbo_vertex.buffer_262144_timeline_semaphore_dma_buf(memory contents mismatch). On recheck it passed 30/30 on both fix and main, and its group passed 10/22 with 0 fail and 12 not supported on both, so it was a one-off.test-stamp-wrap.pyandtest-resources.pyare updated for the moved stamp and the new page class.Risk: two-way · Macs on the g16 backend (M4 G16G; M3 G15S and G15G). A plain revert undoes it.
Not yet: