summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>2026-04-17 13:37:28 +0300
committerPhilipp Stanner <phasta@kernel.org>2026-04-17 15:43:29 +0300
commit77a6809f1dc39376116f8d769a0d2630dc95ad79 (patch)
tree773428e27447ee5ae23887f368dca68e007de823 /include
parent45c211ddf92a1f9b4214ffadaf70d9037f53aaf6 (diff)
downloadlinux-77a6809f1dc39376116f8d769a0d2630dc95ad79.tar.xz
drm/sched: Remove FIFO and RR and simplify to a single run queue
Since the new FAIR policy is in general better than FIFO and almost as good as round-robin in interactive use cases, plus the latter has not been the default policy in a long time, we can afford to remove both and leave just FAIR. By doing so we can simplify the scheduler code by making the scheduler to run queue relationship always 1:1 and remove some code. Also, now that the FIFO policy is gone the tree of entities is not a FIFO tree any more so rename it to just the tree. 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-14-tvrtko.ursulin@igalia.com
Diffstat (limited to 'include')
-rw-r--r--include/drm/gpu_scheduler.h36
1 files changed, 4 insertions, 32 deletions
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
index 790f7ecb6b85..80e5ae2d61ec 100644
--- a/include/drm/gpu_scheduler.h
+++ b/include/drm/gpu_scheduler.h
@@ -100,8 +100,7 @@ struct drm_sched_entity {
* @lock:
*
* Lock protecting the run-queue (@rq) to which this entity belongs,
- * @priority, the list of schedulers (@sched_list, @num_sched_list) and
- * the @rr_ts field.
+ * @priority and the list of schedulers (@sched_list, @num_sched_list).
*/
spinlock_t lock;
@@ -155,18 +154,6 @@ struct drm_sched_entity {
enum drm_sched_priority priority;
/**
- * @rq_priority: Run-queue priority
- */
- enum drm_sched_priority rq_priority;
-
- /**
- * @rr_ts:
- *
- * Fake timestamp of the last popped job from the entity.
- */
- ktime_t rr_ts;
-
- /**
* @job_queue: the list of jobs of this entity.
*/
struct spsc_queue job_queue;
@@ -263,8 +250,7 @@ struct drm_sched_entity {
* struct drm_sched_rq - queue of entities to be scheduled.
*
* @sched: the scheduler to which this rq belongs to.
- * @lock: protects @entities, @rb_tree_root, @rr_ts and @head_prio.
- * @rr_ts: monotonically incrementing fake timestamp for RR mode.
+ * @lock: protects @entities, @rb_tree_root and @head_prio.
* @entities: list of the entities to be scheduled.
* @rb_tree_root: root of time based priority queue of entities for FIFO scheduling
* @head_prio: priority of the top tree element.
@@ -278,7 +264,6 @@ struct drm_sched_rq {
spinlock_t lock;
/* Following members are protected by the @lock: */
- ktime_t rr_ts;
struct list_head entities;
struct rb_root_cached rb_tree_root;
enum drm_sched_priority head_prio;
@@ -365,13 +350,6 @@ struct drm_sched_fence *to_drm_sched_fence(struct dma_fence *f);
*/
struct drm_sched_job {
/**
- * @submit_ts:
- *
- * When the job was pushed into the entity queue.
- */
- ktime_t submit_ts;
-
- /**
* @sched:
*
* The scheduler this job is or will be scheduled on. Gets set by
@@ -574,11 +552,7 @@ struct drm_sched_backend_ops {
* @credit_count: the current credit count of this scheduler
* @timeout: the time after which a job is removed from the scheduler.
* @name: name of the ring for which this scheduler is being used.
- * @num_user_rqs: Number of run-queues. This is at most
- * DRM_SCHED_PRIORITY_COUNT, as there's usually one run-queue per
- * priority, but could be less.
- * @num_rqs: Equal to @num_user_rqs for FIFO and RR and 1 for the FAIR policy.
- * @sched_rq: An allocated array of run-queues of size @num_rqs;
+ * @rq: Scheduler run queue.
* @job_scheduled: once drm_sched_entity_flush() is called the scheduler
* waits on this wait queue until all the scheduled jobs are
* finished.
@@ -610,9 +584,7 @@ struct drm_gpu_scheduler {
atomic_t credit_count;
long timeout;
const char *name;
- u32 num_rqs;
- u32 num_user_rqs;
- struct drm_sched_rq **sched_rq;
+ struct drm_sched_rq *rq;
wait_queue_head_t job_scheduled;
atomic64_t job_id_count;
struct workqueue_struct *submit_wq;