Repository navigation
drm/asahi: g17: skip own-pair fragment wait in J813 CrossPairOrder - #3253
Conversation
On J813/J815, CrossPairOrder::All serialized every render's tiling kick behind global LAST_FRAGMENT, including the same pair's own previous fragment kick (last.qid() == qids[1]). The requestor 0x9a ISP parameter fetch fault occurred when tiling ran beside another context's fragment kick, which is always on a different pair; a pair's own tiling ring already shares one VM slot and orders its own kicks. Skip own-pair fragment kicks in CrossPairOrder::dependency() for All as well as TaskAfterTask so same-context TA/3D can pipeline across render passes while keeping cross-context TA/3D isolation intact. Update cross_pair_order_tests to cover both own-pair skipping and other-pair ordering on CrossPairOrder::All. Signed-off-by: Nick <nekreshen@yandex.ru>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J813 (MacBook Air 13" M5) at Kernel: main
The g17 host tests in Not run: Godot TPS or another workload with many render passes per frame, so the own-pair skip isn't measured. Multi-client concurrent render stress wasn't run either. Assisted-by: LLM (Claude:Opus 5.5) |
|
J704 (MacBook Pro 14" M5, T8142, G17G) at
The J704 is also on terrain and refract run at single-digit fps on the J704 with or without this PR, while every other scene runs at 850-2900 fps. At that rate glmark2's whole-number FPS cannot tell 4 from 7 reliably, so I would not read a gain into those two lines. I'm looking into the stall itself separately. Not run: Godot or any other workload with many render passes per frame, and multi-client stress. |
|
Thank you guys! |
There was a problem hiding this comment.
Verdict: MERGE at a50ecc21
Blockers: none (note: cancelled KUnit CI jobs need a rerun to turn green before merge).
Checked: no Apple material, no AI attribution, no new chip/SoC/board/firmware gates, no cmdline hacks, human Signed-off-by, algebraically identical for CrossPairOrder::TaskAfterTask, preserves cross-context LAST_FRAGMENT isolation on CrossPairOrder::All while skipping own-pair qids[1], unit tests updated, exact-head hardware rows on J813 and J704 plus J815 A/B performance row, apple-build and host-tests green.
Evidence
- Code inspection:
drivers/gpu/drm/asahi/g17/queue/render.rs:741filtersd.qid() != qids[0] && d.qid() != qids[1]unconditionally. ForCrossPairOrder::TaskAfterTaskthis is identical to the prior(self != Self::TaskAfterTask || last.qid() != qids[1]); forCrossPairOrder::Allit drops only the same pair's own fragment kick while retaining cross-pair dependencies. - Unit test
cross_pair_order_testsverifies bothAll.dependency(word(9), [4, 5]) == Some(word(9))andAll.dependency(word(5), [4, 5]) == None. - Hardware rows at exact head
a50ecc21: J813 (gig3m, 15 minglmark2-es2-drm, 0 GPU faults/timeouts) and J704 (term-guy, 8 minglmark2-es2-drmwith KWin, 0 GPU faults/timeouts), plus J815 TPS A/B (+2.3% fps, 0 faults). - CI at
a50ecc21:apple-build,host-tests,pr-text,readinessPASS;KUnit asahiand remaining KUnit jobs were cancelled and need rerun before merge. - Non-blocking note: multi-client concurrent render stress (e.g., 8 simultaneous clients on J813/J815) is listed under Not yet and is worth running as a follow-up check if any cross-context regression surfaces.
|
Merge-train status at |
|
J815 (MacBook Air 15" M5, G17G): skipping the pair's own fragment wait makes the Kernel: our J815 tree (
Means: geometry 367.2 → 217.2 µs (−40.8 %), fill 284.2 → 265.8 µs (−6.5 %). The GPU time drops as much as the submit time, because under Kernel log during the runs: 0 GPU lines. Failed units: 0. @RyanTheTide We have no A18 Pro (Neo) here, so we'd take you up on running the Neo row on yours, thank you. @DjDeveloperr code-owner ping for |
|
code-owner ping @DjDeveloperr: closeout merge at |
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
|
Merged. Thanks @m0d16l14n1! The 8-client concurrent render stress on T8142 is tracked in #3576. |
What: Skip the pair's own previous fragment kick (
last.qid() == qids[1]) inCrossPairOrder::dependency()forCrossPairOrder::Allon J813/J815 while keeping theLAST_FRAGMENTwait for every other pair, allowing same-context TA/3D pipelining across render passes without weakening cross-context VM-slot isolation.Tested: J815 MacBook Air 15" M5 (T8142, G17G), kernel
7.3.0-aurora-j815-dev(aurora.ko800d72d3with runtime A/B knobm5_ab_cross_pairmatching this exact logic, Borealisgit-a40cc98b1a,m5_fw_cross_waits=1): Godot TPS 1080p FSR2 voxel GI (knob-fast.sh4 s × 12 cycles, round-robin inside one process):base(All) 46.73 fps (gpu_p5020.776 ms) →CrossContext(skip own pair) 47.81 fps (+1.08 fps / +2.3%, 95% CI[+0.02, +2.07],gpu_p5020.255 ms = −0.521 ms/frame); 114,133 own-pair waits skipped, 0 GPU faults. Regression line: 0 SELinux denials (N/A on this image), 0 failed units, 0 new kernel errors.Risk: two-way door · J813/J815 (T8142) M5 Macs; all other chips already use
CrossPairOrder::TaskAfterTask, which already skippedqids[1].Not yet: Multi-client concurrent render stress (e.g. 8 simultaneous clients) on this exact branch tip; J813 (13" Air) hardware row.
Details
CrossPairOrder::Allwas added on J813 because running a tiling kick beside another context's fragment kick caused ISP parameter fetch faults (requestor 0x9a) through the wrong VM slot. BecauseCrossPairOrder::dependency()only filteredlast.qid() != qids[1]forTaskAfterTask,Allalso inserted a TA dependency on the same pair's own previous fragment kick (qids[1]), serializing every render pass's TA behind the previous render pass's 3D within a single client (31.5 render passes/frame in Godot TPS).Filtering
d.qid() != qids[1]unconditionally inCrossPairOrder::dependency()keeps every cross-pair (cross-context)LAST_FRAGMENTdependency intact while allowing same-context TA/3D overlap.cross_pair_order_testsis updated to assert thatCrossPairOrder::Allstill emits a dependency for another pair (word(9)on[4, 5]) and returnsNonefor its own pair (word(5)on[4, 5]).Evidence
Machine: J815 MacBook Air 15" M5 (T8142, G17G), kernel
7.3.0-aurora-j815-dev, Borealisgit-a40cc98b1a,m5_fw_cross_waits=1.knob-fast.sh cp 4 12 -- base:base cc:m5_ab_cross_pair=1 tt:m5_ab_cross_pair=2:base(All)cc(skipqids[1], keep cross-pair)[+0.02, +2.07]tt(TaskAfterTask)[+0.09, +1.59]m5_ab_state:cross_pair_added=261777 cross_pair_skipped=114133, 0 GPU faults.