Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap
@ 2026-01-28  0:48 Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 01/11] drm/pagemap: Add helper to access zone_device_data Matthew Brost
                   ` (13 more replies)
  0 siblings, 14 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

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:
Average migrate 2M cpu time (us, percentage): 552.36049107142857142857, .71943789893868318799
Average migrate 64K cpu time (us, percentage): 24.97767857142857142857, .34789908128526791960

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

After patch 5 in this series CPU time during 2M / 64K fault with a migration:
Average migrate 2M cpu time (us, percentage): 158.52901785714285714286, .42740093699505625280
Average migrate 64K cpu time (us, percentage): 14.00000000000000000000, .23276613905846987437

- Patches 2-4 implement dma-map IOVA API for system pages

- Patch 5 optimizes this a bit but questionable if we need if this
  needed if 2M pages are enabled

- Patches 6-11 implement a IOVA API for multi-GPU PoC. I'm told drivers
  shouldn't call dma-map IOVA API for multi-device but including it as
  reference for a design we'd like to get to with high-speed fabrics in
  mind.

Still an RFC as patches 6-11 may not be able to merged in there current
form, the series can be split if needed to merge eariler patches.

Matt

v2:
 - Include missing basline patch for CI
v3:
 - Fix memory corruption
 - PoC IOVA alloc for multi-GPU

Francois Dugast (1):
  drm/pagemap: Add helper to access zone_device_data

Matthew Brost (10):
  drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM
  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: Reduce number of IOVA link calls
  drm/pagemap: Add IOVA interface to DRM pagemap
  drm/xe: Stub out DRM pagemap IOVA alloc implementation
  drm/pagemap: Use device-to-device IOVA alloc, link, and sync API for
    DRM pagemap
  drm/xe: Drop BO dma-resv lock during SVM migrate-to-device
  drm/xe: Implement DRM pagemap IOVA vfuncs
  drm/gpusvm: Use device-to-device IOVA alloc, link, and sync API in GPU
    SVM

 drivers/gpu/drm/drm_gpusvm.c  | 196 ++++++++++++++++---
 drivers/gpu/drm/drm_pagemap.c | 351 +++++++++++++++++++++++++++-------
 drivers/gpu/drm/xe/xe_svm.c   | 143 +++++++++++++-
 include/drm/drm_gpusvm.h      |   5 +
 include/drm/drm_pagemap.h     | 101 ++++++++++
 5 files changed, 693 insertions(+), 103 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2026-01-29 19:33 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 01/11] drm/pagemap: Add helper to access zone_device_data Matthew Brost
2026-01-28 13:53   ` Leon Romanovsky
2026-01-28  0:48 ` [RFC PATCH v3 02/11] drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM Matthew Brost
2026-01-28 14:04   ` Leon Romanovsky
2026-01-28  0:48 ` [RFC PATCH v3 03/11] drm/pagemap: Split drm_pagemap_migrate_map_pages into device / system Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
2026-01-28 14:28   ` Leon Romanovsky
2026-01-28 17:46     ` Matthew Brost
     [not found]       ` <20260128175531.GR1641016@ziepe.ca>
2026-01-28 19:29         ` Matthew Brost
2026-01-28 19:45           ` Leon Romanovsky
2026-01-28 21:04             ` Matthew Brost
2026-01-29 10:14               ` Leon Romanovsky
2026-01-29 18:22                 ` Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 05/11] drm/pagemap: Reduce number of IOVA link calls Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap Matthew Brost
     [not found]   ` <20260128151458.GJ1641016@ziepe.ca>
2026-01-28 18:42     ` Matthew Brost
2026-01-28 19:41       ` Matthew Brost
     [not found]       ` <20260128193509.GU1641016@ziepe.ca>
2026-01-28 20:24         ` Matthew Brost
2026-01-29 18:57           ` Jason Gunthorpe
2026-01-29 19:28             ` Matthew Brost
2026-01-29 19:32               ` Jason Gunthorpe
2026-01-28  0:48 ` [RFC PATCH v3 07/11] drm/xe: Stub out DRM pagemap IOVA alloc implementation Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 08/11] drm/pagemap: Use device-to-device IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 09/11] drm/xe: Drop BO dma-resv lock during SVM migrate-to-device Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 10/11] drm/xe: Implement DRM pagemap IOVA vfuncs Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 11/11] drm/gpusvm: Use device-to-device IOVA alloc, link, and sync API in GPU SVM Matthew Brost
2026-01-28  0:59 ` ✗ CI.checkpatch: warning for Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3) Patchwork
2026-01-28  1:01 ` ✓ CI.KUnit: success " Patchwork
2026-01-28  1:42 ` ✓ Xe.CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox