drm/sched: Optimise drm_sched_entity_push_job
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Wed, 16 Oct 2024 12:20:09 +0000 (13:20 +0100)
committerPhilipp Stanner <pstanner@redhat.com>
Thu, 17 Oct 2024 10:15:11 +0000 (12:15 +0200)
commitd42a254633c773921884a19e8a1a0f53a31150c3
tree2c6bd912108333219ab30e0e3a07da701386e9fc
parentfd3b2c5f40a1e028bc813284260d430257444334
drm/sched: Optimise drm_sched_entity_push_job

In FIFO mode (which is the default), both drm_sched_entity_push_job() and
drm_sched_rq_update_fifo(), where the latter calls the former, are
currently taking and releasing the same entity->rq_lock.

We can avoid that design inelegance, and also have a miniscule
efficiency improvement on the submit from idle path, by introducing a new
drm_sched_rq_update_fifo_locked() helper and pulling up the lock taking to
its callers.

v2:
 * Remove drm_sched_rq_update_fifo() altogether. (Christian)

v3:
 * Improved commit message. (Philipp)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Luben Tuikov <ltuikov89@gmail.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241016122013.7857-2-tursulin@igalia.com
drivers/gpu/drm/scheduler/sched_entity.c
drivers/gpu/drm/scheduler/sched_main.c
include/drm/gpu_scheduler.h