Skip to content

Commit ed931fb

Browse files
mbrost05Lucas De Marchi
authored andcommitted
drm/xe: Take job list lock in xe_sched_add_pending_job
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. Fixes: 7ddb940 ("drm/xe: Sample ctx timestamp to determine if jobs have timed out") Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241003001657.3517883-2-matthew.brost@intel.com (cherry picked from commit 90521df) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 761f916 commit ed931fb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpu/drm/xe/xe_gpu_scheduler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ xe_sched_invalidate_job(struct xe_sched_job *job, int threshold)
6363
static inline void xe_sched_add_pending_job(struct xe_gpu_scheduler *sched,
6464
struct xe_sched_job *job)
6565
{
66+
spin_lock(&sched->base.job_list_lock);
6667
list_add(&job->drm.list, &sched->base.pending_list);
68+
spin_unlock(&sched->base.job_list_lock);
6769
}
6870

6971
static inline

0 commit comments

Comments
 (0)