summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>2026-04-17 11:37:21 +0100
committerPhilipp Stanner <phasta@kernel.org>2026-04-17 14:43:28 +0200
commit94e18404007d3d4c3438ca31d1430a7cf562bd59 (patch)
tree13fe0d8cbf4d38ee30e8f88e134fb9008b69a30b /include/linux/timerqueue.h
parentdf5ff8b62a47bb6a378c81ce8aff267f6e5c9e3f (diff)
drm/sched: Implement RR via FIFO
Round-robin being the non-default policy and unclear how much it is used, we can notice that it can be implemented using the FIFO data structures if we only invent a fake submit timestamp which is monotonically increasing inside drm_sched_rq instances. So instead of remembering which was the last entity the scheduler worker picked we can simply bump the picked one to the bottom of the tree, which ensures round-robin behaviour between all active queued jobs. If the picked job was the last from a given entity, we remember the assigned fake timestamp and use it to re-insert the job once it re-joins the queue. This ensures the job neither overtakes all already queued jobs, neither it goes last. Instead it keeps the position after the currently queued jobs and before the ones which haven't yet been queued at the point the entity left the queue. Advantage is that we can consolidate to a single code path and remove a bunch of code. Downside is round-robin mode now needs to lock on the job pop path but that should not have a measurable performance impact. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Cc: Christian König <christian.koenig@amd.com> Cc: Danilo Krummrich <dakr@kernel.org> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Philipp Stanner <phasta@kernel.org> Acked-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20260417103744.76020-7-tvrtko.ursulin@igalia.com
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions