Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stuart Summers <stuart.summers@intel.com>
Cc: intel-xe@lists.freedesktop.org,
	Stuart Summers <stuart.summers@intel.com>
Subject: [PATCH 6/7] drm/xe: Don't send a CLEANUP message on sched pause
Date: Thu,  2 Oct 2025 23:04:43 +0000	[thread overview]
Message-ID: <20251002230444.313505-7-stuart.summers@intel.com> (raw)
In-Reply-To: <20251002230444.313505-1-stuart.summers@intel.com>

When the DRM scheduler has been "paused" (see xe_gpu_scheduler.c),
if we then send a message to cleanup an exec queue at that time,
we will never get a response for it if for some reason the
unpause never happens. This can occur if for some reason during
exec queue creation, the device becomes wedged. The wedge event
will cause that scheduler to become paused and the creation
then leaves a dangling LRC that will never get cleaned up since
the recovery is a driver rebind. So essentially this change
fixes a potential memory leak in the event the device is
wedged during a test unexpectedly (e.g. during an unexpected
hardware failure).

Signed-off-by: Stuart Summers <stuart.summers@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_submit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 55a50c46ea2b..45b72bebfc63 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1732,7 +1732,8 @@ static void guc_exec_queue_destroy(struct xe_exec_queue *q)
 {
 	struct xe_sched_msg *msg = q->guc->static_msgs + STATIC_MSG_CLEANUP;
 
-	if (!(q->flags & EXEC_QUEUE_FLAG_PERMANENT) && !exec_queue_wedged(q))
+	if (!(q->flags & EXEC_QUEUE_FLAG_PERMANENT) && !exec_queue_wedged(q) &&
+	    !READ_ONCE(q->guc->sched.base.pause_submit))
 		guc_exec_queue_add_msg(q, msg, CLEANUP);
 	else
 		__guc_exec_queue_destroy(exec_queue_to_guc(q), q);
-- 
2.34.1


  parent reply	other threads:[~2025-10-02 23:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-02 23:04 [PATCH 0/7] Fix a couple of wedge corner-case memory leaks Stuart Summers
2025-10-02 23:04 ` [PATCH 1/7] drm/xe: Add additional trace points for LRCs Stuart Summers
2025-10-02 23:04 ` [PATCH 2/7] drm/xe: Add a trace point for VM close Stuart Summers
2025-10-02 23:04 ` [PATCH 3/7] drm/xe: Add the BO pointer info to the BO trace Stuart Summers
2025-10-02 23:04 ` [PATCH 4/7] drm/xe: Add new exec queue trace points Stuart Summers
2025-10-02 23:04 ` [PATCH 5/7] drm/xe: Handle missing migration VM on VM creation Stuart Summers
2025-10-02 23:34   ` Lin, Shuicheng
2025-10-03  6:56     ` Matthew Brost
2025-10-03 14:33       ` Summers, Stuart
2025-10-02 23:04 ` Stuart Summers [this message]
2025-10-03 18:50   ` [PATCH 6/7] drm/xe: Don't send a CLEANUP message on sched pause Matthew Brost
2025-10-03 18:53     ` Summers, Stuart
2025-10-02 23:04 ` [PATCH 7/7] drm/xe: Check for GuC responses on disabling scheduling Stuart Summers
2025-10-03 18:54   ` Matthew Brost
2025-10-03 18:58     ` Summers, Stuart
2025-10-03 19:38       ` Matthew Brost
2025-10-03 19:42         ` Summers, Stuart
2025-10-03 19:49           ` Matthew Brost
2025-10-03 19:53             ` Summers, Stuart
2025-10-02 23:11 ` ✗ CI.checkpatch: warning for Fix a couple of wedge corner-case memory leaks Patchwork
2025-10-02 23:12 ` ✓ CI.KUnit: success " Patchwork
2025-10-02 23:58 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-10-03  2:16 ` ✗ Xe.CI.Full: " Patchwork
2025-10-03 14:38   ` Summers, Stuart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251002230444.313505-7-stuart.summers@intel.com \
    --to=stuart.summers@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox