Skip to content

drm/amdkfd: Unmap SVM range from GPU set to no-access

Philip Yang amd-gfx 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 2 repliesSuperseded
  3. v12 patches 6 repliesSuperseded

Changes in v3 from the cover letter

- Patch 1: fix checkpoint_ts atomic double-read race
- Patch 2: move checkpoint timestamp update into svm_range_needs_unmap

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm/amdkfd: Add helper svm_range_update_checkpoint_timestampdrivers/gpu/drm/amd/amdkfd/kfd_priv.h drivers/gpu/drm/amd/amdkfd/kfd_svm.c+50 -370 replies
2/2drm/amdkfd: Unmap svm range from GPU set to no-accessdrivers/gpu/drm/amd/amdkfd/kfd_queue.c drivers/gpu/drm/amd/amdkfd/kfd_svm.c drivers/gpu/drm/amd/amdkfd/kfd_svm.h+76 -420 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFelix Kuehling
SeriesR-b
1/2R-b
2/2

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

Read the v3 thread

Cover letter [PATCH v3 0/2] drm/amdkfd: Unmap SVM range from GPU set to no-access

Setting KFD_IOCTL_SVM_ATTR_NO_ACCESS on a GPU used to do nothing: the range stayed mapped, so the MMU notifier kept evicting GPU queues on CPU page faults even though the app wanted no access from that GPU.

Patch 1 adds a helper to update the fault checkpoint timestamp and makes the timestamp atomic so the page fault handler can read it locklessly.

Patch 2 unmaps the range from each GPU set to no-access. Once no GPU maps the range, the MMU notifier skips queue eviction. It bumps the checkpoint timestamp so retry faults queued before the unmap are dropped.

v3:
- Patch 1: fix checkpoint_ts atomic double-read race
- Patch 2: move checkpoint timestamp update into svm_range_needs_unmap

Philip Yang (2):
drm/amdkfd: Add helper svm_range_update_checkpoint_timestamp drm/amdkfd: Unmap svm range from GPU set to no-access

 drivers/gpu/drm/amd/amdkfd/kfd_priv.h  |   2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_queue.c |   5 +-
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c   | 191 +++++++++++++++----------
 drivers/gpu/drm/amd/amdkfd/kfd_svm.h   |   7 +-
 4 files changed, 126 insertions(+), 79 deletions(-)
Signature · 1 line
2.50.1