Skip to content

Commit ed931fb

Browse files
mbrost05lucasdemarchi
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 <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 90521df) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 761f916 commit ed931fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)