Repository navigation
drm/asahi: g16: leave same-VM FS render order to the FS ring - #3499
Conversation
g16 posts a self-event (0x71 -> 0x71) fs_dep barrier on the FS work ring ahead of every pipelined same-VM render pass that has an in-flight render dependency not already dominated by TA. Every render's FS work goes on the single firmware FS queue, whose works the firmware runs in ring order: macOS 26B123 posts no FS->FS barriers on its FS ring at all (only each pass's own TA barrier ahead of its FS work). On 26B123, each redundant fs_dep barrier takes the firmware's global DAG spinlock, inserts a self-event 0x71 dependency, and forces the kick path to walk backwards through the FS ring and poll SGX MMIO on every FS kick. Post fs_dep only when the FS ring's order does not cover it: behind another VM's render (cross_vm_prev), or whenever a live producer or this consumer carries InitBM (producer_initbm || init_buffer). Stage the fs_dep and fs_order counters on Prefix and commit them to stats only after TA producer publication succeeds. The publication selftest covers the decision and its placement. Signed-off-by: DjDeveloperr <hey@djdev.me>
DjDeveloperr
left a comment
There was a problem hiding this comment.
HOLD at 0c3efcd29427121d4a7555927d9afe566296e439 for one G15 hardware result. The backend binds T8132, T6030 and T8122 (drivers/gpu/drm/asahi/g16/mod.rs:109–118). The barrier decision at drivers/gpu/drm/asahi/g16/engine.rs:4173–4189 applies to all three. A pipelined same-VM render on T6030 or T8122 with an increasing fs_ring order counter, correct dependent output and clean GPU health would cover the other generation.
I found no host ordering or lifetime regression. Logical queues feed one FS ring, including folded renders. Every FS work item follows its own TA barrier (drivers/gpu/drm/asahi/g16/engine.rs:4240–4245). Source inspection establishes enqueue order. Completion and write visibility before the next dependent FS pass rely on firmware. The recorded four-boot J773g ABBA replay passes, with 80/80 pinned CRCs and zero recoveries.
Independent checks passed on the reviewed source tree: 26/26 host selftests, 90 publication tests, native Rust compile and link of aurora.o, strict checkpatch, canonical PR text check, and merge-tree against 00fbe806db23.
|
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, T6030, G15S) row at
J516s second-generation row, 30 Nov: PASS. 34/34 rows passed, 26/26 pinned CRCs matched, and both compression structural checks passed. Pins included compute.uber uniform M3 Pro J516s (T6030, G15S), 30 Nov 2026. Both arms used their own one-shot kernel and matching Staged Two-pass wall-time smoke measurements vs baseline: compute.uber uniform d4 +0.8%, postfx MSAA4 d1/d2 −0.4%/+0.6%, and bindless UBO d1/d2 +1.1%/+3.1%. The two matched postfx/bindless d2 probes recorded FS ring order +16,092 and +17,019, with explicit FS deps +0 both times. Evidence on the controller is in |
There was a problem hiding this comment.
Verdict: MERGE at 0c3efcd2
Blockers: none (wait for the queued KUnit CI jobs to finish green and re-run cancelled readiness before landing).
Checked:
drivers/gpu/drm/asahi/g16/engine.rs&poll.rs:fs_ring_orders_prev(cross_vm_prev, producer_initbm, init_buffer)cleanly elides redundant self-event (0x71 -> 0x71)fs_depbarriers onr.ring[1]while retaining them for cross-VM predecessors and anyInitBMproducer/consumer. Barrier counters (pf.fs_dep,pf.fs_order) are staged onPrefixand committed toself.engine.statsonly after TA producer publication.tools/testing/selftests/drivers/gpu/asahi-m4/test-publication.py: verifies ordering relative tocross_engine_barrier_type(), staging onPrefix, and all truth-table combinations (26/26host tests,90/90publication tests pass).- Hardware row: J773g (
T8132/G16G) exact-head 4-boot ABBA (104 timed rows, 80/80 exact CRCs,fs_ring.dep+0,order+158k..+160k). - Checked for Apple material, tool attribution, private serials, and gating: clean;
MERGEABLEonmain.
Evidence
- Head:
0c3efcd29427(base: main,mergeable: MERGEABLE,+70/-12across 3 files).
Signed-off-by: DjDeveloperr <hey@djdev.me>
There was a problem hiding this comment.
Verdict: HOLD at 7ee656a3
Blockers:
- Hosted CI at
7ee656a3is still pending (18queued jobs:apple-build,host-tests, and KUnit suites). - Exact-head
7ee656a3hardware receipt orhwokcarry-forward is still needed (needs-hw-rowflagged bypr-readinessafter themainmerge).
Checked:
- Forward-merge cleanliness (
+70/-12acrossdrivers/gpu/drm/asahi/g16/engine.rs,poll.rs, andtools/testing/selftests/drivers/gpu/asahi-m4/test-publication.py):7ee656a3cleanly mergesmain(e6c7b03263) onto previously approved0c3efcd2with the feature diff preserved intact. - Ordering & rollback invariants:
fs_ring_orders_prev(cross_vm_prev, producer_initbm, init_buffer)elides redundant same-VM non-InitBM0x71 -> 0x71FS barriers onr.ring[1]while retaining cross-VM and InitBM barriers, and stagesfs_dep/fs_orderstats onPrefixcommitted only after TA producer publication. - Prior hardware evidence (
0c3efcd2): both J773g (M4, G16G) and J516s (M3 Pro, T6030 G15S — 3.16M jobs, 0 GPU faults, 0 failed units) passed.
Evidence
- Delta from
0c3efcd2: PureMerge main(e6c7b03263); no logic changes ing16/engine.rs,g16/poll.rs, ortest-publication.py. - Ready condition: Upgradeable to
APPROVEas soon as the 18 queued CI checks complete green and the7ee656a3hardware-row / carry-forward check clears.
There was a problem hiding this comment.
Verdict: HOLD at 79955df1
Blockers:
- Hosted CI workflows (
apple-build,host-tests, and KUnit suites) are still queued/running at79955df1. - Exact-head
79955df1hardware row orhwokcarry-forward (pr-readinessrequires the current head SHA after themainmerge).
Checked:
- Forward merge
79955df1(7ee656a3..79955df1): only unrelateddrivers/accel/ane/*andinclude/uapi/drm/ane_accel.hfiles entered frommain; zero changes todrivers/gpu/drm/asahi/ortest-publication.pyrelative to the previously audited and dual-generation hardware-verified0c3efcd2tree (J773g M4 G16G and J516s M3 Pro G15S).
Evidence
- Code remains clean across all 3 touched files (
+70/-12). Ready to approve once hosted CI finishes green and the79955df1head SHA is recorded with hardware acceptance.
|
PASS — J773g (M4 mini, T8132 G16G) target row at Setup
|
There was a problem hiding this comment.
Verdict: MERGE at 79955df1d9a9
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Forward merge 79955df1 (7ee656a3..79955df1): only unrelated drivers/accel/ane/* and include/uapi/drm/ane_accel.h files entered from main; zero changes to drivers/gpu/drm/asahi/ or test-publication.py relative to the previously audited and dual-generation hardware-verified 0c3efcd2 tree (J773g M4 G16G and J516s M3 Pro G15S).
Follow-ups (not blocking): queued CI; hwok carry-forward to head
|
Merging at |
Bring in main up to 1b2c361. engine.rs: keep main's compute UMA slot conflict (compute_uma_conflict and Flight::compute_uma_mask) in needs_engine_drain(). Keep the TA and FS ring order of #3483 and #3499: same-VM TA->TA and FS->FS barriers are still left to the rings and counted. With every render of another VM drained first, the predecessor on the rings is always of the same VM, so the cross_vm_prev input of ta_ring_orders_prev() and fs_ring_orders_prev() goes away. Main's multisampling rule stays covered: this branch already replaces it with the wider cross-VM drain. test-publication.py: keep main's compute UMA, ring-order and TA producer stats tests on the new signatures. Drop the multisampling fold and VM-mark tests, whose code this branch removes. Signed-off-by: DjDeveloperr <hey@djdev.me>
…r-pairs-on-3201 Bring in #3370's branch, which now carries #3353's branch and main up to 1b2c361. Main changed the one render graph that this series splits into pairs. Each pair now takes main's layout: its FS fw_stamp comes from the firmware-cached ring allocator, it has its own ASC-cached FS notifier page, and the shared scheduling context, now allocated in Graphs::finish(), is handed to every pair there. Pair 0 keeps the allocation order, and later pairs share its legacy_empty and registration barrier as before. Retirement keeps main's model per pair: the uncached TA and FS service stamps gate it, the recovery-suspect path falls back to the stage fw_stamps, and the notifier records are never read. The pair's own targets and the latched per-flight TA/FS channel receipts of this series take the place of main's single-pair queue_passed() and queue_receipt(). Progress, the recovery snapshot and the report read each pair's FS user_stamp[1], as main does for its one pair. Render barriers: behind a render on another pair, the stage-order waits on that pair's fw_stamps are always posted. Behind a render on this pair, which is always of the same VM, the TA->TA and FS->FS barriers are left to the ring's order as in #3483 and #3499, and counted. The counters still commit only on TA producer publication, now on the pair's queues. needs_engine_drain() keeps main's compute UMA slot conflict. Selftests: the mocks index render pairs and read the service stamps. This series' pair tests now set the service stamps instead of the notifier, and main's tests carry the pair fields. Signed-off-by: DjDeveloperr <hey@djdev.me>
What
One self-contained
g16performance commit based cleanly onmain(00fbe806db2322d96561542e7cf92af0874ff0ed):0c3efcd29427(drm/asahi: g16: leave same-VM FS render order to the FS ring): Elide redundant self-event (0x71 -> 0x71)fs_depbarriers onr.ring[1]when!cross_vm_prev && !producer_initbm && !init_buffer, matching Metal's[own_TA_barrier, FS_work]FS ring and avoiding unnecessary firmware DAG spinlock / backward ring walks on pipelined same-VM renders. Stagesfs_depandfs_ordercounters onPrefixand commits them only afterpublish_producersucceeds on the TA ring (orthogonal to#3483TA-ring ordering). Also dynamically parses the passed test count intest-publication.py("tests": 90).Tested
0c3efcd29427121d4a7555927d9afe566296e439:scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.tools/testing/selftests/drivers/gpu/asahi-m4/run-host-tests.py: 26/26 pass (test-publication.py: 90 passed, 0 failed).drivers/gpu/drm/asahi/(aurora.o): compiles cleanly with 0 errors and no new warnings.T8132/G16G B0) exact-head 4-boot ABBA (main00fbe806db23vs0c3efcd29427, 4 fresh boots x 2 passes, 104 timed rows, 80/80 exact pinned CRCs, 8/8 compression structural checks, SLC ON 2 planes, 0 GPU faults/recoveries/hang kills/quarantine,gpubench-vk ae90a40, Mesa90211df6816):render.postfx msaa=4 1080p d2:-0.73% / -3.01%(732.1/736.4 -> 726.8/714.3 us, CRC668d6f0a).render.bindless_ubo 512 d1:-0.26% / -1.90%(265.8/267.7 -> 265.1/262.6 us, CRC1af53d5c).compress.bw array 1440p d4:-0.63% / -0.18%(453.3/448.8 -> 450.5/448.0 us).fs_ringcounters:depdelta+0on all 4 candidate passes;orderdelta+158,812 / +160,103(B1) and+160,856 / +160,108(B2).FSORDalone delivers-2.57%postfx d2,-2.47%postfx d1,-2.02%compress array d4,-0.69%bubo d2,-0.67%shadow d2once TA barriers & uncached notifiers are removed.)Full J773g exact-head ABBA table (104 timed rows, 80/80 exact CRCs)
render.postfx msaa=4d1668d6f0arender.postfx msaa=4d2668d6f0arender.bindless_ubo 512d11af53d5crender.bindless_ubo 512d21af53d5crender.mdi 1024d1f69c5f55render.mdi 1024d4f69c5f55render.shadow depth_onlyd2c0fb9993render.shadow alpha_testd27be9463acompress.bw array 1440pd4render.deferred tile msaa=4d16dc74b48render.deferred tile msaa=4d26dc74b48render.light trid16render.light trid64Risk
Two-way door (low risk): single self-contained change in
drivers/gpu/drm/asahi/g16/with zero UAPI or on-disk impact, cleanly revertible. Cross-VM renders and any live/pendingInitBMproducer or consumer retain the explicit FS->FSfs_depbarrier; own-TA, TA->FS, and compute barriers are unchanged. Touches sharedg16paths bound on T8132 (G16) and T6030/T8122 (G15).Not yet
T6030/T8122) hardware verification row prior to merge.