]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/sched: Avoid double re-lock on the job free path
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Wed, 16 Jul 2025 08:51:17 +0000 (09:51 +0100)
committerPhilipp Stanner <phasta@kernel.org>
Fri, 18 Jul 2025 09:44:54 +0000 (11:44 +0200)
commit36caa026b28a49aa91495698350ce46577293e9d
tree4404c1877b495888322c28ba4a2a43820ce109af
parent0864197382fa7c8c2641bff0f36355bf4bd76398
drm/sched: Avoid double re-lock on the job free path

Currently the job free work item will lock sched->job_list_lock first time
to see if there are any jobs, free a single job, and then lock again to
decide whether to re-queue itself if there are more finished jobs.

Since drm_sched_get_finished_job() already looks at the second job in the
queue we can simply add the signaled check and have it return the presence
of more jobs to be freed to the caller. That way the work item does not
have to lock the list again and repeat the signaled check.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250716085117.56864-1-tvrtko.ursulin@igalia.com
drivers/gpu/drm/scheduler/sched_main.c