Skip to content

Rework amdgpu HW fence refocunt and update scheduler parent fence refcount.

Andrey Grodzovsky amd-gfx dri-devel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesNew
  2. v15 patches 22 repliesSuperseded

Changes in v2 from the cover letter

Update race preventionby fixing by swithing from amdgpu_irq_get/put to enable/desable_irq (Christian) Drop refcount fix for amdgpu_job->external_hw_fence as it was causing underflow in direct submissions

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4drm/amdgpu: Add put fence in amdgpu_fence_driver_clear_job_fencesdrivers/gpu/drm/amd/amdgpu/amdgpu_fence.c+3 -10 replies
2/4drm/amdgpu: Prevent race between late signaled fences and GPU reset.drivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h+23 -00 replies
3/4drm/sched: Partial revert of 'drm/sched: Keep s_fence->parent pointer'drivers/gpu/drm/scheduler/sched_main.c+10 -30 replies
4/4drm/amdgpu: Follow up change to previous drm scheduler change.drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c drivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +1 more+29 -110 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchChristian KönigYiqing Yao
1/4R-b
2/4
3/4T-b
4/4T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] Rework amdgpu HW fence refocunt and update scheduler parent fence refcount.

Yiqing raised a problem of negative fence refcount for resubmitted jobs in amdgpu and suggested a workaround in [1]. I took a look myself and discovered some deeper problems both in amdgpu and scheduler code.

Yiqing helped with testing the new code and also drew a detailed refcount and flow tracing diagram for parent (HW) fence life cycle and refcount under various cases for the proposed patchset at [2].

v2:
Update race preventionby fixing by swithing from amdgpu_irq_get/put to enable/desable_irq (Christian) Drop refcount fix for amdgpu_job->external_hw_fence as it was causing underflow in direct submissions

TODO - Follow up cleanup to totally get rid of amdgpu_job->external_hw_fence

[1] - https://lore.kernel.org/all/[email protected]/t/#r00c728fcc069b1276642c325bfa9d82bf8fa21a3
[2] - https://drive.google.com/file/d/1yEoeW6OQC9WnwmzFW6NBLhFP_jD0xcHm/view?usp=sharing

Andrey Grodzovsky (4):
drm/amdgpu: Add put fence in amdgpu_fence_driver_clear_job_fences drm/amdgpu: Prevent race between late signaled fences and GPU reset. drm/sched: Partial revert of 'drm/sched: Keep s_fence->parent pointer' drm/amdgpu: Follow up change to previous drm scheduler change.

 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 31 +++++++++++++++++-----
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c  | 29 ++++++++++++++++++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c    |  4 ---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h   |  1 +
 drivers/gpu/drm/scheduler/sched_main.c     | 13 ++++++---
 6 files changed, 65 insertions(+), 15 deletions(-)
Signature · 1 line
2.25.1