[RFC PATCH 0/2] drm/amdgpu: Reduce the notifier_lock contention

Thomas Hellström thomas.hellstrom at linux.intel.com
Thu Oct 7 13:26:28 UTC 2021


In the interest of sharing as much of possible of the userptr design,
two rfc patches that are aiming to reduce the userptr notifier_lock
contention.

We have these changes already in i915, but we wanted to lift them to dri-
devel in the amdgpu context for discussion to make sure we don't miss
anything important.

The first patch addresses the case where idling a single userptr bo
for even a simple invalidation, stalls command submission across the device.
Since the notifier callback is guaranteed to run to *completion* by the
notifier code without a racing successful command submission, moving the
fence wait out of the notifier lock should be safe.

The second patch probably has a smaller impact and might avoid some
contention particularly if traversing long userptr lists. The notifier sem
is also locked interruptible during command submission.

Any comments appreciated.

Cc: Christian König <christian.koenig at amd.com>

Thomas Hellström (2):
  drm/amdgpu: Move dma_resv waiting outside the notifier lock
  drm/amdgpu: Use an rwsem for the notifier lock

 drivers/gpu/drm/amd/amdgpu/amdgpu.h              |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c           | 12 ++++++++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c       |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c           | 11 ++++++-----
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c          |  2 +-
 6 files changed, 18 insertions(+), 13 deletions(-)

-- 
2.31.1



More information about the dri-devel mailing list