From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: paulo.r.zanoni@intel.com, matthew.auld@intel.com
Subject: [PATCH 1/2] drm/xe: Take job list lock in xe_sched_add_pending_job
Date: Wed, 2 Oct 2024 17:16:56 -0700 [thread overview]
Message-ID: <20241003001657.3517883-2-matthew.brost@intel.com> (raw)
In-Reply-To: <20241003001657.3517883-1-matthew.brost@intel.com>
A fragile micro optimization in xe_sched_add_pending_job relied on both
the GPU scheduler being stopped and fence signaling stopped to safely
add a job to the pending list without the job list lock in
xe_sched_add_pending_job. Remove this optimization and just take the job
list lock.
Reported-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2822
Fixes: 7ddb9403dd74 ("drm/xe: Sample ctx timestamp to determine if jobs have timed out")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
drivers/gpu/drm/xe/xe_gpu_scheduler.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler.h b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
index 5ad5629a6c60..64b2ae6839db 100644
--- a/drivers/gpu/drm/xe/xe_gpu_scheduler.h
+++ b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
@@ -63,7 +63,9 @@ xe_sched_invalidate_job(struct xe_sched_job *job, int threshold)
static inline void xe_sched_add_pending_job(struct xe_gpu_scheduler *sched,
struct xe_sched_job *job)
{
+ spin_lock(&sched->base.job_list_lock);
list_add(&job->drm.list, &sched->base.pending_list);
+ spin_unlock(&sched->base.job_list_lock);
}
static inline
--
2.34.1
next prev parent reply other threads:[~2024-10-03 0:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 0:16 [PATCH 0/2] TDR fixes Matthew Brost
2024-10-03 0:16 ` Matthew Brost [this message]
2024-10-03 6:39 ` [PATCH 1/2] drm/xe: Take job list lock in xe_sched_add_pending_job Matthew Auld
2024-10-03 0:16 ` [PATCH 2/2] drm/xe: Don't free job in TDR Matthew Brost
2024-10-03 7:06 ` Matthew Auld
2024-10-03 14:05 ` Matthew Brost
2024-10-03 14:15 ` Matthew Auld
2024-10-03 14:37 ` Matthew Brost
2024-10-03 15:10 ` Matthew Auld
2024-10-03 0:33 ` ✓ CI.Patch_applied: success for TDR fixes Patchwork
2024-10-03 0:34 ` ✓ CI.checkpatch: " Patchwork
2024-10-03 0:35 ` ✓ CI.KUnit: " Patchwork
2024-10-03 0:46 ` ✓ CI.Build: " Patchwork
2024-10-03 0:49 ` ✓ CI.Hooks: " Patchwork
2024-10-03 0:50 ` ✓ CI.checksparse: " Patchwork
2024-10-03 1:09 ` ✓ CI.BAT: " Patchwork
2024-10-03 2:11 ` ✗ CI.FULL: failure " Patchwork
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=20241003001657.3517883-2-matthew.brost@intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=paulo.r.zanoni@intel.com \
/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