[CI v1 0/4] Resolve suspend-resume racing with GuC destroy-context-worker

Alan Previn alan.previn.teres.alexis at intel.com
Thu Jul 27 00:07:13 UTC 2023


This series is the result of debugging issues root caused to
races between the GuC's destroyed_worker_func being triggered vs
repeating suspend-resume cycles with concurrent delayes
fence signals for engine-freeing.

The reproduction steps require that an app is created right before
the start of the suspend cycle where it creates a new gem
context and submits a tiny workload that would complete in the
middle of the suspend cycle. However this app uses dma-buffer
sharing or dma-fence with non-GPU objects or signals that
eventually triggers a FENCE_FREE via__i915_sw_fence_notify that
connects to engines_notify -> free_engines_rcu ->
intel_context_put -> kref_put(&ce->ref..) that queues the
worker after the GuCs CTB has been disabled (i.e. after
i915-gem's suspend-late flows).

This sequence is a corner-case and required repeating this
app->suspend->resume cycle ~1500 times across 4 identical
systems to see it. That said, based on above callstack, it
is clear that merely flushing the context destruction worker,
which is obviously missing and needed, isn't sufficient.

Because of that, this series adds additional patches besides
the obvious flushing of the worker during the suspend flows.
It includes (1) closing a race against the CTB disabling and
(2) not infinitely waiting in intel_gt_pm_wait_timeout_for_idle
when in the suspend-flow.

Alan Previn (4):
  drm/i915/guc: Flush context destruction worker at suspend
  drm/i915/guc: Holdoff context destruction when CT's aren't enabled
  drm/i915/guc: Close deregister-context race against CT-loss
  drm/i915/gt: Timeout when waiting for idle in suspending

 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  2 +-
 drivers/gpu/drm/i915/gt/intel_gt_pm.c         | 13 ++++-
 drivers/gpu/drm/i915/gt/intel_gt_pm.h         |  7 ++-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 52 +++++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.h |  2 +
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |  7 +++
 drivers/gpu/drm/i915/gt/uc/intel_uc.h         |  1 +
 drivers/gpu/drm/i915/intel_wakeref.c          | 14 +++--
 drivers/gpu/drm/i915/intel_wakeref.h          |  5 +-
 9 files changed, 90 insertions(+), 13 deletions(-)


base-commit: 50f130ab3021dd575aca3fab9c08eae15cd323a8
-- 
2.39.0



More information about the Intel-gfx-trybot mailing list