aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/scheduler/sched_main.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <[email protected]>2024-10-16 12:20:09 +0000
committerPhilipp Stanner <[email protected]>2024-10-17 10:15:11 +0000
commitd42a254633c773921884a19e8a1a0f53a31150c3 (patch)
tree2c6bd912108333219ab30e0e3a07da701386e9fc /drivers/gpu/drm/scheduler/sched_main.c
parentdrm/panel: s6e3ha8: select CONFIG_DRM_DISPLAY_DSC_HELPER (diff)
downloadkernel-d42a254633c773921884a19e8a1a0f53a31150c3.tar.gz
kernel-d42a254633c773921884a19e8a1a0f53a31150c3.zip
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 <[email protected]> Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Luben Tuikov <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Philipp Stanner <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Philipp Stanner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/scheduler/sched_main.c')
-rw-r--r--drivers/gpu/drm/scheduler/sched_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index 36db5c7736fc..f2d47b382bdb 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -163,14 +163,15 @@ static inline void drm_sched_rq_remove_fifo_locked(struct drm_sched_entity *enti
}
}
-void drm_sched_rq_update_fifo(struct drm_sched_entity *entity, ktime_t ts)
+void drm_sched_rq_update_fifo_locked(struct drm_sched_entity *entity, ktime_t ts)
{
/*
* Both locks need to be grabbed, one to protect from entity->rq change
* for entity from within concurrent drm_sched_entity_select_rq and the
* other to update the rb tree structure.
*/
- spin_lock(&entity->rq_lock);
+ lockdep_assert_held(&entity->rq_lock);
+
spin_lock(&entity->rq->lock);
drm_sched_rq_remove_fifo_locked(entity);
@@ -181,7 +182,6 @@ void drm_sched_rq_update_fifo(struct drm_sched_entity *entity, ktime_t ts)
drm_sched_entity_compare_before);
spin_unlock(&entity->rq->lock);
- spin_unlock(&entity->rq_lock);
}
/**