Skip to content

drm/xe: Fix VM teardown and migration queue recovery

Arvind Yadav dri-devel intel-xe 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 3 repliesIn review
  2. v15 patches 12 repliesSuperseded

Changes in v2 from the cover letter

- Reduce the series to four patches following review.
- Run deferred VM close and final VM destruction on the module-lifetime destroy workqueue.
- Use a shared queue-wait budget during file close and defer teardown when queues remain.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4drm/xe: Hold a device reference across deferred VM destructiondrivers/gpu/drm/xe/xe_vm.c+8 -31 reply
2/4drm/xe: Disable scheduling early on FD close to avoid CAT error cascadedrivers/gpu/drm/xe/xe_guc_exec_queue_types.h drivers/gpu/drm/xe/xe_guc_submit.c+43 -50 replies
3/4drm/xe: Mark VMs as closing before queue cleanupdrivers/gpu/drm/xe/xe_device.c drivers/gpu/drm/xe/xe_pagefault.c drivers/gpu/drm/xe/xe_svm.c +3 more+33 -41 reply
4/4drm/xe: Defer VM teardown until exec queue cleanup completesdrivers/gpu/drm/xe/xe_device.c drivers/gpu/drm/xe/xe_exec_queue.c drivers/gpu/drm/xe/xe_vm.c +2 more+202 -231 reply

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchMatthew BrostJia YaoJonathan CavittSanjay Yadav
1/4R-b T-b
2/4T-b R-b
3/4T-b
4/4T-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 4 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/4] drm/xe: Fix VM teardown and migration queue recovery

On BMG, terminating a process with Ctrl+C while GPU work is running under VRAM pressure can cause an RCS page fault followed by a migration queue timeout on BCS8. Recovery can then end in repeated timeouts and device wedging.

During file close, exec queues are killed asynchronously. VM teardown can remove their mappings before queue cleanup has finished, while the hardware may still access them.

This series starts scheduling disable earlier, marks VMs as closing before queue cleanup, and keeps their mappings until the tracked queues have been freed. It also holds a device reference across final VM destruction.

File close uses one five-second queue-wait budget across all VMs. If cleanup is still pending, VM teardown is deferred. VM destroy defers without waiting for queues whose handles remain owned by userspace. Existing teardown waits are unchanged.

With the reduced four-patch series, I have not reproduced the failure in my current testing. The hardware link between the RCS fault and the BCS8 stall remains under investigation.

Changes in v2:
- Reduce the series to four patches following review.
- Run deferred VM close and final VM destruction on the module-lifetime destroy workqueue.
- Use a shared queue-wait budget during file close and defer teardown when queues remain.

Arvind Yadav (3):
drm/xe: Hold a device reference across deferred VM destruction drm/xe: Mark VMs as closing before queue cleanup drm/xe: Defer VM teardown until exec queue cleanup completes

Matthew Brost (1):
drm/xe: Disable scheduling early on FD close to avoid CAT error
cascade

 drivers/gpu/drm/xe/xe_device.c               |  25 ++-
 drivers/gpu/drm/xe/xe_exec_queue.c           |  22 ++-
 drivers/gpu/drm/xe/xe_guc_exec_queue_types.h |   2 +-
 drivers/gpu/drm/xe/xe_guc_submit.c           |  46 ++++-
 drivers/gpu/drm/xe/xe_pagefault.c            |   2 +-
 drivers/gpu/drm/xe/xe_svm.c                  |   3 +-
 drivers/gpu/drm/xe/xe_vm.c                   | 191 +++++++++++++++++--
 drivers/gpu/drm/xe/xe_vm.h                   |  14 +-
 drivers/gpu/drm/xe/xe_vm_types.h             |  16 ++
 9 files changed, 286 insertions(+), 35 deletions(-)
Signature · 1 line
2.43.0