Skip to content

Fix amdgpu_vm_pt_free warning

Philip Yang amd-gfx 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 3 repliesIn review
  2. v17 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7drm/amdgpu: Rename vm invalidate lock to status_lockdrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h+18 -161 reply
2/7drm/amdgpu: Use vm status_lock to protect relocated listdrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+15 -80 replies
3/7drm/amdgpu: Use vm status_lock to protect vm idle listdrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+3 -10 replies
4/7drm/amdgpu: Use vm status_lock to protect vm moved listdrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+11 -40 replies
5/7drm/amdgpu: Use vm status_lock to protect vm evicted listdrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+22 -50 replies
6/7drm/amdgpu: Use vm status_lock to protect pt freedrivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c+3 -00 replies
7/7drm/amdgpu: Fix amdgpu_vm_pt_free warningdrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c+47 -32 replies

Reviews trailers per patch

2 of 7 patches have a Reviewed-by or Acked-by.

PatchFelix Kuehling
1/7A-b
2/7
3/7
4/7
5/7
6/7
7/7R-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/7] Fix amdgpu_vm_pt_free warning

When SVM range is unmapped from CPU, the mmu notifier callback update GPU page table to unmap the SVM range from GPU, this is the unlocked page table update context as we cannot take vm reservation lock. If unmapping from GPU free pt bo, this cause warning as vm reservation lock is not hold.

To fix the warning/race issue, we schedule pt_free_work to free pt bo. This has another race to remove vm_bo entry from vm status lists. Some of the vm status lists are protected by vm invalidate lock and the rest of lists are protected by vm reservation lock.

The purpose of this patch series is to use one vm status_lock to protect all vm status lists, and use it in pt_free_work to fix the race and remove the warning.

v2: Correct comments style, move status_lock definition before all the list_head members

Philip Yang (7):
drm/amdgpu: Rename vm invalidate lock to status_lock drm/amdgpu: Use vm status_lock to protect relocated list drm/amdgpu: Use vm status_lock to protect vm idle list drm/amdgpu: Use vm status_lock to protect vm moved list drm/amdgpu: Use vm status_lock to protect vm evicted list drm/amdgpu: Use vm status_lock to protect pt free drm/amdgpu: Fix amdgpu_vm_pt_free warning

 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c    | 97 ++++++++++++++++-------
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h    |  9 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 44 +++++++++-
 3 files changed, 116 insertions(+), 34 deletions(-)
Signature · 1 line
2.35.1