Add HMM-based SVM memory manager to KFD v2
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest44 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/44 | drm/amdgpu: replace per_device_list by arraydrivers/ drivers/ drivers/ +2 more | +111 | 1 reply | |
| 2/44 | drm/amdkfd: helper to convert gpu id and idxdrivers/ drivers/ | +35 | 0 replies | |
| 3/44 | drm/amdkfd: add svm ioctl APIdrivers/ drivers/ drivers/ +2 more | +147 | 0 replies | |
| 4/44 | drm/amdkfd: register svm rangedrivers/ drivers/ drivers/ +3 more | +914 | 0 replies | |
| 5/44 | drm/amdkfd: add svm ioctl GET_ATTR opdrivers/ | +164 | 0 replies | |
| 6/44 | drm/amdgpu: add common HMM get pages functiondrivers/ drivers/ drivers/ | +100 | 0 replies | |
| 7/44 | drm/amdkfd: validate svm range system memorydrivers/ drivers/ | +106 | 0 replies | |
| 8/44 | drm/amdkfd: deregister svm rangedrivers/ drivers/ drivers/ | +305 | 0 replies | |
| 9/44 | drm/amdgpu: export vm update mapping interfacedrivers/ drivers/ | +20 | 0 replies | |
| 10/44 | drm/amdkfd: map svm range to GPUsdrivers/ drivers/ | +374 | 0 replies | |
| 11/44 | drm/amdkfd: svm range eviction and restoredrivers/ drivers/ drivers/ +1 more | +149 | 0 replies | |
| 12/44 | drm/amdkfd: add xnack enabled flag to kfd_processdrivers/ drivers/ | +40 | 0 replies | |
| 13/44 | drm/amdkfd: add ioctl to configure and query xnack retriesdrivers/ include/ | +70 | 0 replies | |
| 14/44 | drm/amdkfd: register HMM device private zonedrivers/ drivers/ drivers/ +3 more | +161 | 0 replies | |
| 15/44 | drm/amdkfd: validate vram svm range from TTMdrivers/ drivers/ | +355 | 0 replies | |
| 16/44 | drm/amdkfd: support xgmi same hive mappingdrivers/ | +25 | 0 replies | |
| 17/44 | drm/amdkfd: copy memory through gart tabledrivers/ drivers/ | +177 | 0 replies | |
| 18/44 | drm/amdkfd: HMM migrate ram to vramdrivers/ drivers/ drivers/ +1 more | +460 | 0 replies | |
| 19/44 | drm/amdkfd: HMM migrate vram to ramdrivers/ drivers/ drivers/ +1 more | +473 | 0 replies | |
| 20/44 | drm/amdkfd: invalidate tables on page retry faultdrivers/ drivers/ drivers/ | +64 | 0 replies | |
| 21/44 | drm/amdgpu: enable 48-bit IH timestamp counterdrivers/ | +1 | 0 replies | |
| 22/44 | drm/amdkfd: page table restore through svm APIdrivers/ drivers/ | +71 | 0 replies | |
| 23/44 | drm/amdkfd: SVM API call to restore page tablesdrivers/ | +15 | 0 replies | |
| 24/44 | drm/amdkfd: add svm_bo reference for eviction fencedrivers/ drivers/ drivers/ | +10 | 0 replies | |
| 25/44 | drm/amdgpu: add param bit flag to create SVM BOsdrivers/ drivers/ | +6 | 0 replies | |
| 26/44 | drm/amdkfd: add svm_bo eviction mechanism supportdrivers/ drivers/ | +153 | 0 replies | |
| 27/44 | drm/amdgpu: svm bo enable_signal call conditiondrivers/ | +14 | 0 replies | |
| 28/44 | drm/amdgpu: add svm_bo eviction to enable_signal cbdrivers/ | +8 | 0 replies | |
| 29/44 | drm/amdgpu: reserve fence slot to update page tabledrivers/ | +8 | 1 reply | |
| 30/44 | drm/amdkfd: refine migration policy with xnack ondrivers/ drivers/ drivers/ +3 more | +157 | 0 replies | |
| 31/44 | drm/amdkfd: add svm range validate timestampdrivers/ drivers/ | +24 | 0 replies | |
| 32/44 | drm/amdkfd: multiple gpu migrate vram to vramdrivers/ drivers/ drivers/ | +96 | 0 replies | |
| 33/44 | drm/amdkfd: Add SVM API support capability bitsdrivers/ drivers/ | +12 | 0 replies | |
| 34/44 | drm/amdkfd: Fix dma unmappingdrivers/ drivers/ drivers/ | +5 | 0 replies | |
| 35/44 | drm/amdkfd: Call mutex_destroydrivers/ | +4 | 0 replies | |
| 36/44 | drm/amdkfd: Fix spurious restore failuresdrivers/ | +2 | 0 replies | |
| 37/44 | drm/amdkfd: Fix svm_bo_list locking in eviction workerdrivers/ | +17 | 0 replies | |
| 38/44 | drm/amdkfd: Simplify split_by_granularitydrivers/ drivers/ drivers/ | +30 | 0 replies | |
| 39/44 | drm/amdkfd: Point out several race conditionsdrivers/ drivers/ | +25 | 0 replies | |
| 40/44 | drm/amdkfd: Return pdd from kfd_process_device_from_gduiddrivers/ drivers/ drivers/ | +29 | 0 replies | |
| 41/44 | drm/amdkfd: Remove broken deferred mappingdrivers/ drivers/ | +2 | 0 replies | |
| 42/44 | drm/amdkfd: Allow invalid pages in migration.srcdrivers/ | +38 | 0 replies | |
| 43/44 | drm/amdkfd: Correct locking during migration and mappingdrivers/ drivers/ drivers/ | +310 | 0 replies | |
| 44/44 | drm/amdkfd: Nested locking and invalidation of child rangesdrivers/ drivers/ | +37 | 0 replies |
Reviews trailers per patch
2 of 44 patches have a Reviewed-by or Acked-by.
| Patch | Christian König | Jonathan Kim |
|---|---|---|
| 1/44 | R-b | |
| 2/44 | ||
| 3/44 | ||
| 4/44 | ||
| 5/44 | ||
| 6/44 | ||
| 7/44 | ||
| 8/44 | ||
| 9/44 | ||
| 10/44 | ||
| 11/44 | ||
| 12/44 | ||
| 13/44 | ||
| 14/44 | ||
| 15/44 | ||
| 16/44 | ||
| 17/44 | ||
| 18/44 | ||
| 19/44 | ||
| 20/44 | ||
| 21/44 | ||
| 22/44 | ||
| 23/44 | ||
| 24/44 | ||
| 25/44 | ||
| 26/44 | ||
| 27/44 | ||
| 28/44 | ||
| 29/44 | R-b | |
| 30/44 | ||
| 31/44 | ||
| 32/44 | ||
| 33/44 | ||
| 34/44 | ||
| 35/44 | ||
| 36/44 | ||
| 37/44 | ||
| 38/44 | ||
| 39/44 | ||
| 40/44 | ||
| 41/44 | ||
| 42/44 | ||
| 43/44 | ||
| 44/44 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/44] Add HMM-based SVM memory manager to KFD v2
Since the last patch series I sent on Jan 6 a lot has changed. Patches 1-33 are the cleaned up, rebased on amd-staging-drm-next 5.11 version from about a week ago. The remaining 11 patches are current work-in-progress with further cleanup and fixes.
MMU notifiers and CPU page faults now can split ranges and update our range data structures without taking heavy locks by doing some of the critical work in a deferred work handler. This includes updating MMU notifiers and the SVM range interval tree. In the mean time, new ranges can live as children of their parent ranges until the deferred work handler consolidates them in the main interval tree.
We also added proper DMA mapping of system memory pages.
Current work in progress is cleaning up all the locking, simplifying our code and data structures and resolving a few known bugs.
This series and the corresponding ROCm Thunk and KFDTest changes are also available on gitub:
https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver/tree/fxkamd/hmm-wip
https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/tree/fxkamd/hmm-wip
An updated Thunk
Alex Sierra (10):
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/amdgpu: enable 48-bit IH timestamp counter 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/amdgpu: svm bo enable_signal call condition drm/amdgpu: add svm_bo eviction to enable_signal cb
Felix Kuehling (22):
drm/amdkfd: map svm range to GPUs
drm/amdkfd: svm range eviction and restore drm/amdkfd: validate vram svm range from TTM drm/amdkfd: HMM migrate ram to vram
drm/amdkfd: HMM migrate vram to ram
drm/amdkfd: invalidate tables on page retry fault drm/amdkfd: page table restore through svm API drm/amdkfd: add svm_bo eviction mechanism support drm/amdkfd: refine migration policy with xnack on drm/amdkfd: add svm range validate timestamp drm/amdkfd: multiple gpu migrate vram to vram drm/amdkfd: Fix dma unmapping
drm/amdkfd: Call mutex_destroy
drm/amdkfd: Fix spurious restore failures drm/amdkfd: Fix svm_bo_list locking in eviction worker drm/amdkfd: Simplify split_by_granularity drm/amdkfd: Point out several race conditions drm/amdkfd: Return pdd from kfd_process_device_from_gduid drm/amdkfd: Remove broken deferred mapping drm/amdkfd: Allow invalid pages in migration.src drm/amdkfd: Correct locking during migration and mapping drm/amdkfd: Nested locking and invalidation of child ranges
Philip Yang (12):
drm/amdkfd: add svm ioctl API
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: deregister svm range drm/amdgpu: export vm update mapping interface drm/amdkfd: register HMM device private zone drm/amdkfd: support xgmi same hive mapping drm/amdkfd: copy memory through gart table drm/amdgpu: reserve fence slot to update page table drm/amdkfd: Add SVM API support capability bits
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 + 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 | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 90 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 48 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 11 + drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 1 + drivers/gpu/drm/amd/amdkfd/Kconfig | 1 + drivers/gpu/drm/amd/amdkfd/Makefile | 4 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 173 +- drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | 4 + drivers/gpu/drm/amd/amdkfd/kfd_iommu.c | 8 +- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 922 ++++++ drivers/gpu/drm/amd/amdkfd/kfd_migrate.h | 59 + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 54 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 191 +- .../amd/amdkfd/kfd_process_queue_manager.c | 6 +- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2865 +++++++++++++++++ drivers/gpu/drm/amd/amdkfd/kfd_svm.h | 175 + drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 6 + drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 10 +- include/uapi/linux/kfd_ioctl.h | 171 +- 26 files changed, 4681 insertions(+), 249 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.31.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel