Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 00/29] PREFETCH and MADVISE for SVM ranges
@ 2025-03-14  8:01 Himal Prasad Ghimiray
  2025-03-14  8:01 ` [RFC 01/29] drm/xe: Introduce xe_vma_op_prefetch_range struct for prefetch of ranges Himal Prasad Ghimiray
                   ` (29 more replies)
  0 siblings, 30 replies; 52+ messages in thread
From: Himal Prasad Ghimiray @ 2025-03-14  8:01 UTC (permalink / raw)
  To: intel-xe; +Cc: matthew.brost, thomas.hellstrom, oak.zeng, Himal Prasad Ghimiray

Prefetching: Uses the existing ioctl vm_bind and ensures pages are
populated in the requested region and PTEs are updated, preventing GPU
page faults.

Region 0: Ranges remain in SMEM with only PTE updates.
Region 1: Ranges migrate to VRAM with corresponding PTE updates.
Madvise Ioctl:

Provides a user API to assign attributes like pat_index, atomic
operation type, and preferred location for SVM ranges.
The Kernel Mode Driver (KMD) may split existing VMAs to cover input
ranges, assign user-provided attributes, and invalidate existing PTEs so
that the next page fault/prefetch can use the new attributes.
The RFC for PREFETCH [1-12] was previously sent separately
https://lore.kernel.org/intel-xe/20250310124341.1819568-1-himal.prasad.ghimiray@intel.com/T/#t

This series includes prefetch patches as a baseline for madvise patches,
with future versions to be sent as a single series.

Himal Prasad Ghimiray (29):
  drm/xe: Introduce xe_vma_op_prefetch_range struct for prefetch of
    ranges
  drm/xe: Make xe_svm_alloc_vram public
  drm/xe/svm: Helper to add tile masks to svm ranges
  drm/xe/svm: Make to_xe_range a public function
  drm/xe/svm: Make xe_svm_range_* end/start/size public
  drm/xe/vm: Update xe_vma_ops_incr_pt_update_ops to take an increment
    value
  drm/xe/vm: Add an identifier in xe_vma_ops for svm prefetch
  drm/xe: Rename lookup_vma function to xe_find_vma_by_addr
  drm/xe/svm: Allow unaligned addresses and ranges for prefetch
  drm/xe/svm: Refactor usage of drm_gpusvm* function in xe_svm
  drm/xe/svm: Implement prefetch support for SVM ranges
  drm/xe/vm: Add debug prints for SVM range prefetch
  drm/gpuvm: Introduce MADVISE Operations
  drm/xe/uapi: Add madvise interface
  drm/xe/vm: Add attributes struct as member of vma
  drm/xe/vma: Move pat_index to vma attributes
  drm/xe/vma: Modify new_vma to accept struct xe_vma_mem_attr as
    parameter
  drm/gpusvm: Make drm_gpusvm_for_each_* macros public
  drm/xe/svm: Split system allocator vma incase of madvise call
  drm/xe: Implement madvise ioctl for xe
  drm/xe: Allow CPU address mirror VMA unbind with gpu bindings for
    madvise
  drm/xe/svm : Add svm ranges migration policy on atomic access
  drm/xe/madvise: Update migration policy based on preferred location
  drm/xe/svm: Support DRM_XE_SVM_ATTR_PAT memory attribute
  drm/xe/uapi: Add flag for consulting madvise hints on svm prefetch
  drm/xe/svm: Consult madvise preferred location in prefetch
  drm/xe/uapi: Add uapi for vma count and mem attributes
  drm/xe/bo: Add attributes field to xe_bo
  drm/xe/bo : Update atomic_access attribute on madvise

 drivers/gpu/drm/drm_gpusvm.c         |  89 +----
 drivers/gpu/drm/drm_gpuvm.c          | 175 +++++++++-
 drivers/gpu/drm/xe/Makefile          |   1 +
 drivers/gpu/drm/xe/xe_bo.c           |  21 +-
 drivers/gpu/drm/xe/xe_bo_types.h     |   5 +
 drivers/gpu/drm/xe/xe_device.c       |   4 +
 drivers/gpu/drm/xe/xe_gt_pagefault.c |  24 +-
 drivers/gpu/drm/xe/xe_pt.c           |  86 +++--
 drivers/gpu/drm/xe/xe_svm.c          | 215 +++++++++---
 drivers/gpu/drm/xe/xe_svm.h          |  96 ++++++
 drivers/gpu/drm/xe/xe_vm.c           | 497 +++++++++++++++++++++++++--
 drivers/gpu/drm/xe/xe_vm.h           |  10 +-
 drivers/gpu/drm/xe/xe_vm_madvise.c   | 375 ++++++++++++++++++++
 drivers/gpu/drm/xe/xe_vm_madvise.h   |  15 +
 drivers/gpu/drm/xe/xe_vm_types.h     |  43 ++-
 include/drm/drm_gpusvm.h             |  96 +++++-
 include/drm/drm_gpuvm.h              |   6 +
 include/uapi/drm/xe_drm.h            | 213 ++++++++++++
 18 files changed, 1748 insertions(+), 223 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_vm_madvise.c
 create mode 100644 drivers/gpu/drm/xe/xe_vm_madvise.h

-- 
2.34.1


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

end of thread, other threads:[~2025-05-14 19:38 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14  8:01 [RFC 00/29] PREFETCH and MADVISE for SVM ranges Himal Prasad Ghimiray
2025-03-14  8:01 ` [RFC 01/29] drm/xe: Introduce xe_vma_op_prefetch_range struct for prefetch of ranges Himal Prasad Ghimiray
2025-04-03 20:59   ` Matthew Brost
2025-03-14  8:01 ` [RFC 02/29] drm/xe: Make xe_svm_alloc_vram public Himal Prasad Ghimiray
2025-03-27 22:45   ` Matthew Brost
2025-03-28  7:51     ` Ghimiray, Himal Prasad
2025-03-14  8:02 ` [RFC 03/29] drm/xe/svm: Helper to add tile masks to svm ranges Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 04/29] drm/xe/svm: Make to_xe_range a public function Himal Prasad Ghimiray
2025-03-28  2:57   ` Matthew Brost
2025-03-14  8:02 ` [RFC 05/29] drm/xe/svm: Make xe_svm_range_* end/start/size public Himal Prasad Ghimiray
2025-03-27 22:46   ` Matthew Brost
2025-03-14  8:02 ` [RFC 06/29] drm/xe/vm: Update xe_vma_ops_incr_pt_update_ops to take an increment value Himal Prasad Ghimiray
2025-03-28  2:56   ` Matthew Brost
2025-03-28  7:52     ` Ghimiray, Himal Prasad
2025-03-14  8:02 ` [RFC 07/29] drm/xe/vm: Add an identifier in xe_vma_ops for svm prefetch Himal Prasad Ghimiray
2025-03-27 22:49   ` Matthew Brost
2025-03-28  7:53     ` Ghimiray, Himal Prasad
2025-03-14  8:02 ` [RFC 08/29] drm/xe: Rename lookup_vma function to xe_find_vma_by_addr Himal Prasad Ghimiray
2025-04-03 21:02   ` Matthew Brost
2025-04-07  6:16     ` Ghimiray, Himal Prasad
2025-03-14  8:02 ` [RFC 09/29] drm/xe/svm: Allow unaligned addresses and ranges for prefetch Himal Prasad Ghimiray
2025-04-03 20:52   ` Matthew Brost
2025-04-07  6:15     ` Ghimiray, Himal Prasad
2025-03-14  8:02 ` [RFC 10/29] drm/xe/svm: Refactor usage of drm_gpusvm* function in xe_svm Himal Prasad Ghimiray
2025-04-03 20:54   ` Matthew Brost
2025-04-07  6:15     ` Ghimiray, Himal Prasad
2025-03-14  8:02 ` [RFC 11/29] drm/xe/svm: Implement prefetch support for SVM ranges Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 12/29] drm/xe/vm: Add debug prints for SVM range prefetch Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 13/29] drm/gpuvm: Introduce MADVISE Operations Himal Prasad Ghimiray
2025-03-14  8:46   ` Ghimiray, Himal Prasad
2025-03-17 14:27   ` Danilo Krummrich
2025-03-18 11:58     ` Ghimiray, Himal Prasad
2025-03-14  8:02 ` [RFC 14/29] drm/xe/uapi: Add madvise interface Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 15/29] drm/xe/vm: Add attributes struct as member of vma Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 16/29] drm/xe/vma: Move pat_index to vma attributes Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 17/29] drm/xe/vma: Modify new_vma to accept struct xe_vma_mem_attr as parameter Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 18/29] drm/gpusvm: Make drm_gpusvm_for_each_* macros public Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 19/29] drm/xe/svm: Split system allocator vma incase of madvise call Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 20/29] drm/xe: Implement madvise ioctl for xe Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 21/29] drm/xe: Allow CPU address mirror VMA unbind with gpu bindings for madvise Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 22/29] drm/xe/svm : Add svm ranges migration policy on atomic access Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 23/29] drm/xe/madvise: Update migration policy based on preferred location Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 24/29] drm/xe/svm: Support DRM_XE_SVM_ATTR_PAT memory attribute Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 25/29] drm/xe/uapi: Add flag for consulting madvise hints on svm prefetch Himal Prasad Ghimiray
2025-05-14 19:26   ` Matthew Brost
2025-03-14  8:02 ` [RFC 26/29] drm/xe/svm: Consult madvise preferred location in prefetch Himal Prasad Ghimiray
2025-03-14  8:02 ` [RFC 27/29] drm/xe/uapi: Add uapi for vma count and mem attributes Himal Prasad Ghimiray
2025-05-14 19:39   ` Matthew Brost
2025-03-14  8:02 ` [RFC 28/29] drm/xe/bo: Add attributes field to xe_bo Himal Prasad Ghimiray
2025-05-14 19:35   ` Matthew Brost
2025-03-14  8:02 ` [RFC 29/29] drm/xe/bo : Update atomic_access attribute on madvise Himal Prasad Ghimiray
2025-03-14 15:00 ` ✗ CI.Patch_applied: failure for PREFETCH and MADVISE for SVM ranges (rev2) Patchwork

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