drm/amdgpu: fix userq eviction-fence rearm reservation
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | Revert "drm/amdgpu: reserve root PD fence slots for userq eviction-fence rearm"drivers/ | +1 | 0 replies | |
| 2/3 | Revert "drm/amdgpu: reserve eviction-fence slot at WPTR caller"drivers/ | +1 | 0 replies | |
| 3/3 | drm/amdgpu: Reserve eviction fence slot during userq rearmdrivers/ | +8 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH v1 0/3] drm/amdgpu: fix userq eviction-fence rearm reservation
From: Vitaly Prosyak <[email protected]>
During user queue restore, the eviction-fence rearm path can attach a replacement BOOKKEEP fence after the BO reservation has been unlocked. Because dma_resv_unlock() discards unused pre-reserved capacity, a BO with no remaining fences can reach dma_resv_add_fence() with max_fences equal to zero. This triggers the dma-resv BUG_ON at dma-resv.c:319 and can crash amdgpu_userq_restore_worker.
The first two patches revert earlier caller-side reservations. The root PD reservation and the WPTR-caller reservation are no longer required once the slot is reserved at the operation that actually attaches the replacement eviction fence. Removing them avoids retaining redundant fence capacity and keeps the reservation accounting local to the rearm path.
The third patch reserves one fence slot in amdgpu_evf_mgr_rearm(), immediately before amdgpu_evf_mgr_attach_fence() is called for each locked BO. The BO is already held by the drm_exec context, so the reservation remains valid for dma_resv_add_fence(). The reservation is kept explicit in the rearm path rather than hidden in the attach helper.
The fix was validated with repeated amd_deadlock runs, including the userqueue restore reproducer.
Vitaly Prosyak (3):
Revert "drm/amdgpu: reserve root PD fence slots for userq
eviction-fence rearm"
Revert "drm/amdgpu: reserve eviction-fence slot at WPTR caller" drm/amdgpu: Reserve eviction fence slot during userq rearm
drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c | 8 ++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 +----- drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 3 +-- 3 files changed, 10 insertions(+), 7 deletions(-)
Signature · 1 line
2.55.0