On 2026-07-29 12:35, Philip Yang wrote:
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
The series is
Reviewed-by: Felix Kuehling <[email protected]>
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(-)