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(-)

-- 
2.43.0

Reply via email to