Repository navigation
drm/asahi: g17: do not host-wait query_access on timestamp-free chains - #3319
Conversation
When a command without timestamp outputs chains its host Publication behind an earlier timestamp-writing command, its Publication stays pending while both are still queued ahead of GPU execution. EnqueueOrdering::build previously treated every covered pending Publication as a host completion wait for query_access computes, forcing the compute to wait on the host for every intermediate timestamp-free render or compute instead of only the actual timestamp-writing ancestors. Track the deduplicated pending timestamp-writer completion fences inherited by timestamp-free commands, wait on the host only for those actual timestamp writers, and keep intermediate timestamp-free producers on firmware barriers so query_access computes do not drain the GPU pipeline. Signed-off-by: DjDeveloperr <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Verdict at Blockers: none. Checked
Before merge
Evidence |
|
J700 (MacBook Neo, G17P B1) at
|
There was a problem hiding this comment.
Verdict: MERGE at 97fe6445 (once cancelled CI checks are rerun green)
Blockers: none (code, KUnit/host tests, and two-generation exact-head hardware rows are ready; rerun the 4 cancelled CI checks before merge).
Checked:
drivers/gpu/drm/asahi/g17/completion/publication.rs,job.rs,queue/mod.rs: verifiedcollect_timestamp_waits()records only actual pending host-timestamp writer fences (pub_ref.has_outputs()or still-pending/failedfence_status(fence) <= 0inheritedtimestamp_waits), deduplicated viapush_unique_fence().- Verified cross-engine
query_accesscomputes covering a timestamp-free producer still add a firmware wait(scheduled, completed)on that intermediate producer while host-waiting only on the actual timestamp writer(s), and still host-wait on any failed (status < 0) entry. - Verified 220/220
g17host tests and exact-head (97fe64450656) hardware rows on both J714s (M5 Pro, G17S: 170/170 query/multiview CTS, GTA V +22.2%, BeamNG +3.1%, 0 faults) and J700 (Neo, G17P: 0 new failures vs base, clean gpubench CRCs).
Evidence
- Diff reviewed at
97fe6445(all 3 files, 373 lines). - CI at review time: 19 passed, 0 failed, 4 cancelled.
|
Merge-train status at |
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
Resolve against main's timestamp-free publication chaining (#3319): carry both the inline_published flag and timestamp_waits in Fences, and both firmware_published and inherited_timestamp_waits through EnqueueOrdering. Main's new firmware wait for a timestamp-free producer now records its inline_published flag too, so the two vectors stay paired in the zip in Queue::enqueue(). Signed-off-by: DjDeveloperr <[email protected]>
What
When a G17 command without host-timestamp outputs chains its
Publicationbehind an earlier timestamp-writing command, itsPublicationstays pending while both commands are queued ahead of GPU execution.EnqueueOrdering::build()previously treated every covered pendingPublicationas a host completion wait forquery_accesscompute commands, forcing those computes to stall on the host for every intermediate timestamp-free render or compute instead of only the actual timestamp-writing ancestors.Track the deduplicated pending timestamp-writer completion fences inherited by timestamp-free commands (
timestamp_writers), wait on the host only for those actual timestamp writers, and keep intermediate timestamp-free producers on firmware barriers. This matches native overlap:query_accesscomputes only drain on the host for commands that actually publish host timestamps, rather than draining the whole render/compute pipeline on every query copy.Tested
./scripts/checkpatch.pl --strict --git origin/main..HEAD: 0 errors, 0 warnings, 0 checks.python3 tools/asahi/run-host-tests.py --only g17: 220/220 passed.3024x1964,GP_NOANAT=1, identical Mesa kitinst-Klibvulkan_asahi.so1cf23c9f22d5):deqp-vk1.4.7.1) on97fe64450656(rebased onorigin/main2094ccb2a036):dEQP-VK.query_pool.occlusion_query.copy_*: 152/152 Passed, 0 Failed (7 Not supported).dEQP-VK.query_pool.concurrent_queries.*: 2/2 Passed, 0 Failed.dEQP-VK.multiview.queries.*: 16/16 Passed, 0 Failed (0 regressions on drm/asahi g17: multiview query timestamps wrong on main (regression since 11-16, J700) #3243).origin/mainbaseline (7.3.0-m5-hops1):41.24,41.41(mean41.33).NO_TS, 3 runs across 2 boots:50.17,51.51,49.89, mean50.52): +22.2% mean (+24.6% peak) overorigin/main.71.42%to89.31%(+17.89 pp); 83% ofquery_accesscomputes (5,587/6,735) overlap via firmware barriers (R->C HOST WAITmedian+208.3 us->-1,425.6 us).wcusasteady-state windows 2–5 FPS (0 GPU faults, 0 kernel errors):origin/mainbaseline:34.79mean (34.50/35.33medians).NO_TS):35.87mean (35.92/35.86medians, +3.1% overorigin/main, GPU union busy91.82%).Risk
Risk: two-way · G17 scheduler ordering (
drivers/gpu/drm/asahi/g17/completion/publication.rs,job.rs,queue/mod.rs); no UAPI or firmware ABI changes, single-commit revert cleanly restores previous host-wait behavior.Not yet