drm/xe: Bump prefetch BO LRU via GPUSVM devmem callback

Add xe_svm_devmem_lru_bump() and set it as drm_gpusvm_ctx.devmem_fn in
the prefetch worker so each backing BO is moved to the LRU tail during
get_pages.

v2:
- Guard xe_svm_devmem_lru_bump() against foreign device-memory
  allocations before casting to xe_bo: return early when
  devmem_allocation->ops != &dpagemap_devmem_ops. A shared
  device_private_page_owner can hand us another driver's allocation.
  (Matthew Brost / Sashiko AI review)
- Add stub for function (CI)

v3:
- Guard xe_svm_devmem_lru_bump() body with CONFIG_DRM_XE_PAGEMAP; it
  references dpagemap_devmem_ops and to_xe_bo(), which only exist when
  PAGEMAP is enabled. Fixes the build with GPUSVM=y, PAGEMAP=n.
  (Sashiko AI review)

v4:
- Fix xe_svm_devmem_lru_bump() kernel-doc to explain the locking (Matt)

Suggested-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20261001033602.3166274-9-himal.prasad.ghimiray@intel.com
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
Himal Prasad Ghimiray 2026-10-01 09:06:06 +05:30 • committed by Rodrigo Vivi
commit 508444b9f6
No known key found for this signature in database
GPG key ID: FA625F640EEB13CA
3 changed files with 42 additions and 0 deletions