Skip to content

Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap

Matthew Brost dri-devel intel-xe 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest5 patches 4 repliesIn review
  2. v65 patches 2 repliesSuperseded
  3. v55 patches 5 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v44 patches13 repliesSuperseded
v3 RFC11 patches19 repliesSuperseded
v2 RFC3 patches6 repliesSuperseded
v1 RFC2 patches0 repliesSuperseded

Changes in v7 from the cover letter

- Address sashiko's comments

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVMdrivers/gpu/drm/drm_gpusvm.c include/drm/drm_gpusvm.h+50 -81 reply
2/5drm/pagemap: Drop source_peer_migrates flag and assume truedrivers/gpu/drm/drm_pagemap.c drivers/gpu/drm/xe/xe_svm.c include/drm/drm_pagemap.h+6 -141 reply
3/5drm/pagemap: Split drm_pagemap_migrate_map_pages into device / systemdrivers/gpu/drm/drm_pagemap.c+100 -511 reply
4/5drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemapdrivers/gpu/drm/drm_pagemap.c+70 -151 reply
5/5drm/pagemap: Fix drm_pagemap_migrate_unmap_pages kerneldocdrivers/gpu/drm/drm_pagemap.c+3 -20 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchThomas HellströmFrancois Dugast
1/5R-b
2/5R-b R-b
3/5A-b R-b
4/5R-b R-b
5/5R-b

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

Read the v7 thread

Cover letter [PATCH v7 0/5] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap

The dma-map IOVA alloc, link, and sync APIs perform significantly better than dma-map / dma-unmap, as they avoid costly IOMMU synchronizations. This difference is especially noticeable when mapping a 2MB region in 4KB pages.

Use dma-map IOVA alloc, link, and sync APIs for GPU SVM and DRM page, which mappings between the CPU and GPU.

Initial results are promising.

Baseline CPU time during 2M / 64K fault with a migration (device THP disabled):
Average migrate 2M cpu time (us, percentage): 333.99665178571428571429, .61102853199282922865 Average migrate 64K cpu time (us, percentage): 18.62723214285714285714, .30127985269960467173

After this series CPU time during 2M / 64K fault with a migration (device THP disabled):
Average migrate 2M cpu time (us, percentage): 224.81808035714285714286, .51412827364772602557 Average migrate 64K cpu time (us, percentage): 14.65625000000000000000, .25659463050529524405

Matt

v2:
- Include missing basline patch for CI
v3:
- Fix memory corruption
- PoC IOVA alloc for multi-GPU
v4:
- Pack IOVA / drop dummy pages
- Drop multi-GPU IOVA alloc
v5:
- Address Thomas's comments
v6:
- Address Francois's comments
v7:
- Address sashiko's comments

Matthew Brost (5):
drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM drm/pagemap: Drop source_peer_migrates flag and assume true drm/pagemap: Split drm_pagemap_migrate_map_pages into device / system drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM
pagemap
drm/pagemap: Fix drm_pagemap_migrate_unmap_pages kerneldoc

 drivers/gpu/drm/drm_gpusvm.c  |  53 ++++++--
 drivers/gpu/drm/drm_pagemap.c | 229 ++++++++++++++++++++++++----------
 drivers/gpu/drm/xe/xe_svm.c   |   1 -
 include/drm/drm_gpusvm.h      |   5 +
 include/drm/drm_pagemap.h     |   9 +-
 5 files changed, 218 insertions(+), 79 deletions(-)
Signature · 1 line
2.34.1