Fix a couple of wedge corner-case memory leaks
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 patches 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | drm/xe: Add additional trace points for LRCsdrivers/ drivers/ drivers/ | +48 | 0 replies | |
| 2/7 | drm/xe: Add a trace point for VM closedrivers/ drivers/ | +8 | 0 replies | |
| 3/7 | drm/xe: Add the BO pointer info to the BO tracedrivers/ | +4 | 0 replies | |
| 4/7 | drm/xe: Add new exec queue trace pointsdrivers/ drivers/ drivers/ | +31 | 0 replies | |
| 5/7 | drm/xe: Correct migration VM teardown orderdrivers/ | +5 | 2 replies | |
| 6/7 | drm/xe: Clean up GuC software state after a wedgedrivers/ | +12 | 3 replies | |
| 7/7 | drm/xe/doc: Add GuC submission kernel-docDocumentation/ Documentation/ drivers/ | +79 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/7] Fix a couple of wedge corner-case memory leaks
Most of the patches in this series are just adding some debug hints to help track these down. I split these up in case we want to pick and choose which ones to include in the tree. I found them useful.
Also add a little documentation on the various stages handled within the GuC exec queue submission path.
The main interesting patch is the last one in the series which fixes some corner cases when the driver becomes wedged in the middle of either communication with the DRM scheduler or in the event the GuC becomes unresponsive. In both of these cases there is a chance we could leak memory around the exec queue members like the LRC and the LRC BO. This patch fixes those scenarios.
v2: Address feedback from Matt:
- Let the DRM scheduler handle pausing/unpausing
- Still do the wait after scheduling disable/deregister as with the previous patch, but skip the intermediate software-based schedule disable using the "banned" flag and instead just jump straight to the deregister handling which will fully reset the queue state. Note that for this case I am seeing a hardware failure after submitting to GuC but before receiving the response from GuC. So even if we wedge in this case (monitoring the hardware state change), the queue itself is not wedged because of the active GuC submission (CT is not stalled at that point).
v3: Add back in the xe pause checks and instead just kickstart
message handling in the guc_submi_fini() routine before doing the async wait there.
v4: Handle the CT communication loss during wedge asynchronously
Also combine those last two patches into one to handle wedge cleanup generally.
v5: Add a new patch with a little documentation on the GuC
submission handling stages.
Move the scheduler kickstart and destruction call on the dangling queues into the wedged_fini() callback. These only get called now for queues which are in an error state - wedge was called, but these weren't fully cleaned up as seen by the lack of exec_queue reference at the time of wedging.
Also fix the migration ordering teardown reference mistake pointed by Matt in the previous series rev.
Stuart Summers (7):
drm/xe: Add additional trace points for LRCs drm/xe: Add a trace point for VM close drm/xe: Add the BO pointer info to the BO trace drm/xe: Add new exec queue trace points drm/xe: Correct migration VM teardown order drm/xe: Clean up GuC software state after a wedge drm/xe/doc: Add GuC submission kernel-doc
Documentation/gpu/xe/index.rst | 1 + Documentation/gpu/xe/xe_guc_submit.rst | 8 +++ drivers/gpu/drm/xe/xe_exec_queue.c | 4 ++ drivers/gpu/drm/xe/xe_guc_submit.c | 93 ++++++++++++++++++++++++-- drivers/gpu/drm/xe/xe_lrc.c | 4 ++ drivers/gpu/drm/xe/xe_lrc.h | 3 + drivers/gpu/drm/xe/xe_migrate.c | 9 +-- drivers/gpu/drm/xe/xe_trace.h | 22 +++++- drivers/gpu/drm/xe/xe_trace_bo.h | 12 +++- drivers/gpu/drm/xe/xe_trace_lrc.h | 42 +++++++++++- drivers/gpu/drm/xe/xe_vm.c | 2 + 11 files changed, 187 insertions(+), 13 deletions(-) create mode 100644 Documentation/gpu/xe/xe_guc_submit.rst
Signature · 1 line
2.34.1