Skip to content

drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

Thomas Hellström dri-devel intel-xe 6 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 0 repliesNew
  2. v53 patches 3 repliesSuperseded
  3. v43 patches 4 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v33 patches10 repliesSuperseded
v23 patches10 repliesSuperseded
v13 patches0 repliesSuperseded

Changes in v6 from the cover letter

- Fix an uninitialized variable (CI)

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemapDocumentation/gpu/rfc/gpusvm.rst drivers/gpu/drm/Makefile drivers/gpu/drm/drm_gpusvm.c +7 more+958 -8730 replies
2/3drm/pagemap: Add a populate_mm opdrivers/gpu/drm/drm_gpusvm.c drivers/gpu/drm/drm_pagemap.c include/drm/drm_pagemap.h+92 -180 replies
3/3drm/xe: Implement and use the drm_pagemap populate_mm opdrivers/gpu/drm/drm_pagemap.c drivers/gpu/drm/xe/xe_svm.c drivers/gpu/drm/xe/xe_svm.h +2 more+77 -490 replies

Reviews trailers per patch

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

PatchHimal Prasad GhimirayMatthew Brost
1/3R-b
2/3R-b
3/3R-b

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

Read the v6 thread

Cover letter [PATCH v6 0/3] drm/gpusvm, drm/pagemap, drm/xe: Restructure migration in preparation for multi-device

This patchset modifies the migration part of drm_gpusvm to drm_pagemap and adds a populate_mm() op to drm_pagemap.

The idea is that the device that receives a pagefault determines if it wants to migrate content and to where. It then calls the populate_mm() method of relevant drm_pagemap.

This functionality was mostly already in place, but hard-coded for xe only without going through a pagemap op. Since we might be dealing with separate devices moving forward, it also now becomes the responsibilit of the populate_mm() op to grab any necessary local device runtime pm references and keep them held while its pages are present in an mm (struct mm_struct).

On thing to decide here is whether the populate_mm() callback should sit on a struct drm_pagemap for now while we sort multi-device usability out or whether we should add it (or something equivalent) to struct dev_pagemap.

v2:
- Rebase.
v3:
- Documentation updates (CI, Matt Brost)
- Don't change TTM buffer object type for VRAM allocations (Matt Brost) v4:
- Documentation Updates (Himal Ghimiray, Matt Brost)
- Add an assert (Matt Brost)
v5:
- Rebase
- Add R-Bs and SOBs.
v6:
- Fix an uninitialized variable (CI)

Matthew Brost (1):
drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap

Thomas Hellström (2):
drm/pagemap: Add a populate_mm op
drm/xe: Implement and use the drm_pagemap populate_mm op

 Documentation/gpu/rfc/gpusvm.rst     |  12 +-
 drivers/gpu/drm/Makefile             |   6 +-
 drivers/gpu/drm/drm_gpusvm.c         | 762 +-----------------------
 drivers/gpu/drm/drm_pagemap.c        | 838 +++++++++++++++++++++++++++
 drivers/gpu/drm/xe/Kconfig           |  10 +-
 drivers/gpu/drm/xe/xe_bo_types.h     |   2 +-
 drivers/gpu/drm/xe/xe_device_types.h |   2 +-
 drivers/gpu/drm/xe/xe_svm.c          | 125 ++--
 drivers/gpu/drm/xe/xe_svm.h          |  10 +-
 drivers/gpu/drm/xe/xe_tile.h         |  11 +
 drivers/gpu/drm/xe/xe_vm.c           |   2 +-
 include/drm/drm_gpusvm.h             |  96 ---
 include/drm/drm_pagemap.h            | 135 +++++
 13 files changed, 1099 insertions(+), 912 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_pagemap.c
Signature · 1 line
2.49.0