Add HMM-based SVM memory manager to KFD
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest35 patches 48 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/35 | drm/amdkfd: select kernel DEVICE_PRIVATE optiondrivers/ | +1 | 0 replies | |
| 2/35 | drm/amdgpu: replace per_device_list by arraydrivers/ drivers/ drivers/ +2 more | +111 | 0 replies | |
| 3/35 | drm/amdkfd: helper to convert gpu id and idxdrivers/ drivers/ | +35 | 0 replies | |
| 4/35 | drm/amdkfd: add svm ioctl APIdrivers/ include/ | +133 | 0 replies | |
| 5/35 | drm/amdkfd: Add SVM API support capability bitsdrivers/ drivers/ | +7 | 0 replies | |
| 6/35 | drm/amdkfd: register svm rangedrivers/ drivers/ drivers/ +3 more | +741 | 0 replies | |
| 7/35 | drm/amdkfd: add svm ioctl GET_ATTR opdrivers/ | +173 | 0 replies | |
| 8/35 | drm/amdgpu: add common HMM get pages functiondrivers/ drivers/ drivers/ | +100 | 1 reply | |
| 9/35 | drm/amdkfd: validate svm range system memorydrivers/ drivers/ drivers/ | +91 | 0 replies | |
| 10/35 | drm/amdkfd: register overlap system memory rangedrivers/ | +294 | 0 replies | |
| 11/35 | drm/amdkfd: deregister svm rangedrivers/ | +86 | 0 replies | |
| 12/35 | drm/amdgpu: export vm update mapping interfacedrivers/ drivers/ | +18 | 1 reply | |
| 13/35 | drm/amdkfd: map svm range to GPUsdrivers/ drivers/ | +233 | 0 replies | |
| 14/35 | drm/amdkfd: svm range eviction and restoredrivers/ drivers/ drivers/ +1 more | +169 | 0 replies | |
| 15/35 | drm/amdkfd: add xnack enabled flag to kfd_processdrivers/ drivers/ | +40 | 0 replies | |
| 16/35 | drm/amdkfd: add ioctl to configure and query xnack retriesdrivers/ include/ | +70 | 0 replies | |
| 17/35 | drm/amdkfd: register HMM device private zonedrivers/ drivers/ drivers/ +2 more | +157 | 6 replies | |
| 18/35 | drm/amdkfd: validate vram svm range from TTMdrivers/ drivers/ | +335 | 0 replies | |
| 19/35 | drm/amdkfd: support xgmi same hive mappingdrivers/ | +24 | 0 replies | |
| 20/35 | drm/amdkfd: copy memory through gart tabledrivers/ drivers/ | +177 | 0 replies | |
| 21/35 | drm/amdkfd: HMM migrate ram to vramdrivers/ drivers/ drivers/ +1 more | +436 | 0 replies | |
| 22/35 | drm/amdkfd: HMM migrate vram to ramdrivers/ drivers/ drivers/ +1 more | +392 | 0 replies | |
| 23/35 | drm/amdkfd: invalidate tables on page retry faultdrivers/ | +17 | 0 replies | |
| 24/35 | drm/amdkfd: page table restore through svm APIdrivers/ drivers/ | +80 | 0 replies | |
| 25/35 | drm/amdkfd: SVM API call to restore page tablesdrivers/ | +15 | 0 replies | |
| 26/35 | drm/amdkfd: add svm_bo reference for eviction fencedrivers/ drivers/ drivers/ | +10 | 0 replies | |
| 27/35 | drm/amdgpu: add param bit flag to create SVM BOsdrivers/ drivers/ | +7 | 0 replies | |
| 28/35 | drm/amdkfd: add svm_bo eviction mechanism supportdrivers/ drivers/ | +160 | 0 replies | |
| 29/35 | drm/amdgpu: svm bo enable_signal call conditiondrivers/ | +14 | 4 replies | |
| 30/35 | drm/amdgpu: add svm_bo eviction to enable_signal cbdrivers/ | +8 | 0 replies | |
| 31/35 | drm/amdgpu: reserve fence slot to update page tabledrivers/ | +8 | 1 reply | |
| 32/35 | drm/amdgpu: enable retry fault wptr overflowdrivers/ drivers/ | +22 | 1 reply | |
| 33/35 | drm/amdkfd: refine migration policy with xnack ondrivers/ drivers/ drivers/ +4 more | +180 | 0 replies | |
| 34/35 | drm/amdkfd: add svm range validate timestampdrivers/ drivers/ | +25 | 0 replies | |
| 35/35 | drm/amdkfd: multiple gpu migrate vram to vramdrivers/ drivers/ drivers/ | +103 | 0 replies |
Reviews trailers per patch
4 of 35 patches have a Reviewed-by or Acked-by.
| Patch | Christian König |
|---|---|
| 1/35 | |
| 2/35 | |
| 3/35 | |
| 4/35 | |
| 5/35 | |
| 6/35 | |
| 7/35 | |
| 8/35 | A-b |
| 9/35 | |
| 10/35 | |
| 11/35 | |
| 12/35 | R-b |
| 13/35 | |
| 14/35 | |
| 15/35 | |
| 16/35 | |
| 17/35 | |
| 18/35 | |
| 19/35 | |
| 20/35 | |
| 21/35 | |
| 22/35 | |
| 23/35 | |
| 24/35 | |
| 25/35 | |
| 26/35 | |
| 27/35 | |
| 28/35 | |
| 29/35 | |
| 30/35 | |
| 31/35 | R-b |
| 32/35 | R-b |
| 33/35 | |
| 34/35 | |
| 35/35 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/35] Add HMM-based SVM memory manager to KFD
This is the first version of our HMM based shared virtual memory manager for KFD. There are still a number of known issues that we're working through (see below). This will likely lead to some pretty significant changes in MMU notifier handling and locking on the migration code paths. So don't get hung up on those details yet.
But I think this is a good time to start getting feedback. We're pretty confident about the ioctl API, which is both simple and extensible for the future. (see patches 4,16) The user mode side of the API can be found here:
https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/blob/fxkamd/hmm-wip/src/svm.c
I'd also like another pair of eyes on how we're interfacing with the GPU VM code in amdgpu_vm.c (see patches 12,13), retry page fault handling (24,25), and some retry IRQ handling changes (32).
Known issues:
* won't work with IOMMU enabled, we need to dma_map all pages properly
* still working on some race conditions and random bugs
* performance is not great yet
Alex Sierra (12):
drm/amdgpu: replace per_device_list by array drm/amdkfd: helper to convert gpu id and idx drm/amdkfd: add xnack enabled flag to kfd_process drm/amdkfd: add ioctl to configure and query xnack retries drm/amdkfd: invalidate tables on page retry fault drm/amdkfd: page table restore through svm API drm/amdkfd: SVM API call to restore page tables drm/amdkfd: add svm_bo reference for eviction fence drm/amdgpu: add param bit flag to create SVM BOs drm/amdkfd: add svm_bo eviction mechanism support drm/amdgpu: svm bo enable_signal call condition drm/amdgpu: add svm_bo eviction to enable_signal cb
Philip Yang (23):
drm/amdkfd: select kernel DEVICE_PRIVATE option drm/amdkfd: add svm ioctl API
drm/amdkfd: Add SVM API support capability bits drm/amdkfd: register svm range
drm/amdkfd: add svm ioctl GET_ATTR op drm/amdgpu: add common HMM get pages function drm/amdkfd: validate svm range system memory drm/amdkfd: register overlap system memory range drm/amdkfd: deregister svm range drm/amdgpu: export vm update mapping interface drm/amdkfd: map svm range to GPUs drm/amdkfd: svm range eviction and restore drm/amdkfd: register HMM device private zone drm/amdkfd: validate vram svm range from TTM drm/amdkfd: support xgmi same hive mapping drm/amdkfd: copy memory through gart table drm/amdkfd: HMM migrate ram to vram drm/amdkfd: HMM migrate vram to ram drm/amdgpu: reserve fence slot to update page table drm/amdgpu: enable retry fault wptr overflow drm/amdkfd: refine migration policy with xnack on drm/amdkfd: add svm range validate timestamp drm/amdkfd: multiple gpu migrate vram to vram
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c | 16 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 13 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 83 + drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h | 7 + drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 90 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 47 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 10 + drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 32 +- drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 32 +- drivers/gpu/drm/amd/amdkfd/Kconfig | 1 + drivers/gpu/drm/amd/amdkfd/Makefile | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 170 +- drivers/gpu/drm/amd/amdkfd/kfd_iommu.c | 8 +- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 866 ++++++ drivers/gpu/drm/amd/amdkfd/kfd_migrate.h | 59 + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 52 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 200 +- .../amd/amdkfd/kfd_process_queue_manager.c | 6 +- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2564 +++++++++++++++++ drivers/gpu/drm/amd/amdkfd/kfd_svm.h | 135 + drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 1 + drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 10 +- include/uapi/linux/kfd_ioctl.h | 169 +- 26 files changed, 4296 insertions(+), 291 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_migrate.h create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_svm.c create mode 100644 drivers/gpu/drm/amd/amdkfd/kfd_svm.h
Signature · 6 lines
2.29.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx