Skip to content

Allow scratch page under fault mode for certain platform

Oak Zeng intel-xe 7 versions – Applied

Status from this message: pushed to drm-xe-next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest3 patches 4 repliesApplied
  2. v93 patches 0 repliesSuperseded
  3. v83 patches 2 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v73 patches2 repliesSuperseded
v63 patches1 replySuperseded
v53 patches1 replySuperseded
v13 patches13 repliesSuperseded

Patches in v10 Applied

#Subject and filesSizeRepliesApplied
1/3drm/xe: Introduced needs_scratch bit in device descriptordrivers/gpu/drm/xe/xe_device_types.h drivers/gpu/drm/xe/xe_pci.c+7 -01 reply
2/3drm/xe: Clear scratch page on vm_binddrivers/gpu/drm/xe/xe_pt.c drivers/gpu/drm/xe/xe_vm.c drivers/gpu/drm/xe/xe_vm_types.h+88 -411 reply
3/3drm/xe: Allow scratch page under fault mode for certain platformdrivers/gpu/drm/xe/xe_vm.c include/uapi/drm/xe_drm.h+7 -21 reply

Reviews trailers per patch

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

PatchThomas HellströmMatthew BrostHimal Prasad Ghimiray
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v10 thread

Cover letter [PATCH v10 0/3] Allow scratch page under fault mode for certain platform

Normally scratch page is not allowed when a vm is operate under page fault mode, i.e., in the existing codes, DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE and DRM_XE_VM_CREATE_FLAG_FAULT_MODE are mutual exclusive. The reason is fault mode relies on recoverable page to work, while scratch page can mute recoverable page fault.

On xe2 and xe3, out of bound prefetch can cause page fault and further system hang because xekmd can't resolve such page fault. SYCL and OCL language runtime requires out of bound prefetch to be silently dropped without causing any functional problem, thus the existing behavior doesn't meet language runtime requirement.

At the same time, HW prefetching can cause page fault interrupt. Due to page fault interrupt overhead (i.e., need Guc and KMD involved to fix the page fault), HW prefetching can be slowed by many orders of magnitude.

Fix those problems by allowing scratch page under fault mode for xe2 and xe3. With scratch page in place, HW prefetching could always hit scratch page instead of causing interrupt.

A side effect is, scratch page could hide application program error. Application out of bound accesses are hided by scratch page mapping, instead of get reported to user.

igt test: https://patchwork.freedesktop.org/series/144907/, Test result on BMG:

root@DUT1130BMGFRD:/home/szeng/dii-tools/igt-public/build/tests# ./xe_exec_fault_mode --run-subtest scratch-fault
IGT-Version: 1.30-gde1a3cb42 (x86_64) (Linux: 6.13.0-xe x86_64)
Using IGT_SRANDOM=1738684805 for randomisation
Opened device: /dev/dri/card0
Starting subtest: scratch-fault
Subtest scratch-fault: SUCCESS (0.080s)

Oak Zeng (3):
drm/xe: Introduced needs_scratch bit in device descriptor drm/xe: Clear scratch page on vm_bind
drm/xe: Allow scratch page under fault mode for certain platform

 drivers/gpu/drm/xe/xe_device_types.h |  2 +
 drivers/gpu/drm/xe/xe_pci.c          |  5 ++
 drivers/gpu/drm/xe/xe_pt.c           | 99 ++++++++++++++++++----------
 drivers/gpu/drm/xe/xe_vm.c           | 31 +++++++--
 drivers/gpu/drm/xe/xe_vm_types.h     |  2 +
 include/uapi/drm/xe_drm.h            |  6 +-
 6 files changed, 102 insertions(+), 43 deletions(-)
Signature · 1 line
2.26.3