Commit 3655c590 authored by Luben Tuikov's avatar Luben Tuikov

drm/sched: Rename to drm_sched_wakeup_if_can_queue()

Rename drm_sched_wakeup() to drm_sched_wakeup_if_canqueue() since the former
is misleading, as it wakes up the GPU scheduler _only if_ more jobs can be
queued to the underlying hardware.

This distinction is important to make, since the wake conditional in the GPU
scheduler thread wakes up when other conditions are also true, e.g. when there
are jobs to be cleaned. For instance, a user might want to wake up the
scheduler only because there are more jobs to clean, but whether we can queue
more jobs is irrelevant.

v2: Separate "canqueue" to "can_queue". (Alex D.)

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: default avatarLuben Tuikov <luben.tuikov@amd.com>
Link: https://lore.kernel.org/r/20230517233550.377847-2-luben.tuikov@amd.comReviewed-by: default avatarAlex Deucher <Alexander.Deucher@amd.com>
parent e0727008
...@@ -342,7 +342,7 @@ static void drm_sched_entity_wakeup(struct dma_fence *f, ...@@ -342,7 +342,7 @@ static void drm_sched_entity_wakeup(struct dma_fence *f,
container_of(cb, struct drm_sched_entity, cb); container_of(cb, struct drm_sched_entity, cb);
drm_sched_entity_clear_dep(f, cb); drm_sched_entity_clear_dep(f, cb);
drm_sched_wakeup(entity->rq->sched); drm_sched_wakeup_if_can_queue(entity->rq->sched);
} }
/** /**
...@@ -565,7 +565,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job) ...@@ -565,7 +565,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job)
if (drm_sched_policy == DRM_SCHED_POLICY_FIFO) if (drm_sched_policy == DRM_SCHED_POLICY_FIFO)
drm_sched_rq_update_fifo(entity, submit_ts); drm_sched_rq_update_fifo(entity, submit_ts);
drm_sched_wakeup(entity->rq->sched); drm_sched_wakeup_if_can_queue(entity->rq->sched);
} }
} }
EXPORT_SYMBOL(drm_sched_entity_push_job); EXPORT_SYMBOL(drm_sched_entity_push_job);
...@@ -860,12 +860,12 @@ static bool drm_sched_can_queue(struct drm_gpu_scheduler *sched) ...@@ -860,12 +860,12 @@ static bool drm_sched_can_queue(struct drm_gpu_scheduler *sched)
} }
/** /**
* drm_sched_wakeup - Wake up the scheduler when it is ready * drm_sched_wakeup_if_can_queue - Wake up the scheduler
*
* @sched: scheduler instance * @sched: scheduler instance
* *
* Wake up the scheduler if we can queue jobs.
*/ */
void drm_sched_wakeup(struct drm_gpu_scheduler *sched) void drm_sched_wakeup_if_can_queue(struct drm_gpu_scheduler *sched)
{ {
if (drm_sched_can_queue(sched)) if (drm_sched_can_queue(sched))
wake_up_interruptible(&sched->wake_up_worker); wake_up_interruptible(&sched->wake_up_worker);
......
...@@ -549,7 +549,7 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity, ...@@ -549,7 +549,7 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
unsigned int num_sched_list); unsigned int num_sched_list);
void drm_sched_job_cleanup(struct drm_sched_job *job); void drm_sched_job_cleanup(struct drm_sched_job *job);
void drm_sched_wakeup(struct drm_gpu_scheduler *sched); void drm_sched_wakeup_if_can_queue(struct drm_gpu_scheduler *sched);
void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad); void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad);
void drm_sched_start(struct drm_gpu_scheduler *sched, bool full_recovery); void drm_sched_start(struct drm_gpu_scheduler *sched, bool full_recovery);
void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched); void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment