Repository navigation
Conversation
… work On multi-pair boards (clusters >= 4, G17C and G17D), render_direct() lends one render pair and resolves its dependencies through Pair::own_dependencies(), which only inspects that pair. Meanwhile publication_barriers() skips same-owner renders covered by wait_through[0], assuming the render prefix already ordered them. If the same owner has live prefix-covered work on another render pair (including a pair lent out for preparation or heap growth), neither collector emitted a barrier for it. Add Registry::has_other_pair_dependencies() to walk sibling pairs (with an early exit when wait_through[0] is None and using the existing pair / borrowed_dependencies collectors) and refuse the direct lend to the device-mutex path when any sibling pair holds live prefix-covered work. Run the check in lend_render() ahead of Pair::host_growth_target() so this refusal never resets firmware page high-water accounting. Fixes: d272a70 ("drm/asahi: g17: publish steady-state renders through the port") Signed-off-by: Jeff Queisser <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: Code approved at f21d6ff1a7aa9. Targeted hardware evidence remains open.
Checked: The direct path tests the prefix before lending the pair or sampling heap growth. It checks both resident pairs and borrowed dependency state and falls back to the existing registry-wide dependency path. The guard is based on owner and prefix state. Apple build, host tests and KUnit are green.
Before merge, attach the same-owner cross-pair case and G17C peer row identified in the PR. The useful signal is a live sibling dependency that forces fallback and completes in order, with the ordinary direct path still exercised.
…refix work Pair::own_dependencies() only inspects the lent pair, whereas Registry::render_dependencies() walks every render pair of the owner (including pairs lent out for preparation or heap growth via borrowed_dependencies). Coordinating with #3301, add Registry::has_other_pair_dependencies() and call it in lend_render() ahead of Pair::host_growth_target() so any live or borrowed sibling pair holding work covered by either wait_through[0] or tiling_wait_through[0] (including a sibling whose dependency belongs to the tiling prefix) falls back to the device-mutex path. Extend g17-direct-stage-prefixes-tests.py with direct-vs-mutex parity comparisons and live/borrowed/tiling-only sibling fallback tests plus 3 new mutation traps. Signed-off-by: DjDeveloperr <[email protected]>
|
Thanks @funkzy for this fix. While forward-merging current main (2fd49a6) we found that main already carries it in extended form: 334dbc6 ("refuse direct staged render when sibling pair holds prefix work", merged with #3388) adds the same |
What: Guard
render_direct()against dropping cross-pair prefix dependencies on multi-pair G17 GPUs by refusing the direct lend whenever a sibling render pair for the same owner holds livewait_through[0]-covered work (including a pair currently lent out for preparation or heap growth), falling back to the device-mutex path (Fixes: d272a7060d20).Tested: J775D (Mac Studio, M5 Ultra) at
f21d6ff1a7aa9on baremain(8c6992db4b9f) under published Auraaura-main-7bf44a63on the 27.0 stub:render.light d8(32.72vs32.90 us),render.light d64(31.25vs31.13 us),render.heavy fill 1080p(38.19vs38.17 us),compute.light d8/d64, and 10 s two-pair concurrentrender.light d8stress all pass with 0 GPU faults, 0 recoveries, 0 refusals, 0 new kernel errors, and 0 new failed systemd units.Risk: Two-way door · affects only multi-pair G17 GPUs (
clusters >= 4, G17C and G17D) when a single owner submits renders across more than one render pair concurrently; single-pair boards and single-pair workloads take an O(1) early exit and stay onrender_direct().Not yet: G17C (
J716c/K114c) multi-pair smoke row and a dedicated single-owner cross-pairwait_through[0]reproducer row.Details
Why this shape
render_direct()lends a single render pair (slot) and collects its render dependencies withPair::own_dependencies(), which inspects only that pair. Meanwhile,publication_barriers()omits same-owner renders covered bywait_through[0], relying on the render prefix to have ordered them. When the same owner has live prefix-covered work on a sibling render pair (either resident inentry.pairor lent out inentry.borrowed_dependencies), neither collector emitted a barrier for it.Pair::host_growth_target()would reset firmware page high-water accounting on a refused lend.Registry::has_other_pair_dependencies()reuses the exact samePair::collect_dependencies()andBorrowedDependencies::collect()collectors thatRegistry::render_dependencies()uses, walking sibling pairs for the same owner with an immediate early exit whenwait_through[0]isNone. Calling it inlend_render()beforePair::host_growth_target()routes any cross-pair prefix dependency cleanly back to the device-mutex path without side effects.Change
f21d6ff1a7aa9—drm/asahi: g17: refuse render_direct when a sibling pair holds prefix work: addRegistry::has_other_pair_dependencies()indrivers/gpu/drm/asahi/g17/runtime/render/dependencies.rsand call it ahead ofPair::host_growth_target()inlend_render()(drivers/gpu/drm/asahi/g17/runtime/render/direct.rs).Evidence
Testing
Own-base A/B row on J775D (Mac Studio, M5 Ultra): kit
xpair-1(windowxpair2@20261126-1100) is baremain8c6992db4b9fplus this commit (f21d6ff1a7aa9, no other PRs carried), compared against baseline kitxpair-1b(windowxpair2@20261126-1100), baremain8c6992db4b9falone. Both arms ran one-shot with a read-only root on the default J775D command line under the 27.0 stub and published Auraaura-main-7bf44a63(Hyprland stopped, Borealis3fc21af143, client pinned to 4.608 GHz P-core on the GPU IRQ die; ALARM has no SELinux):xpair-1bxpair-1row_window.sh)BOOT-OK(57 s),steps_rc=0BOOT-OK(55 s),steps_rc=0render.light tri d8(us/submit)32.9032.72render.light tri d64(us/submit)31.1331.25render.heavy fill 1080p d8(us/submit)38.1738.19compute.light d8/d64(us/submit)18.60/17.1119.58/17.04render.light d8(10 s)rc=0(63.20/63.16 us)rc=0(65.96/65.98 us)0 / 0 / 0 / 00 / 0 / 0 / 02/02(same 2) /0aurora.komodule build (CONFIG_DRM_ASAHI=m,CONFIG_DRM_ASAHI_M5=y): 0 new warnings.