From: Luben Tuikov <luben.tuikov@amd.com>
To: Direct Rendering Infrastructure - Development
<dri-devel@lists.freedesktop.org>
Cc: "Alex Deucher" <Alexander.Deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH 2/2] drm/sched: Rename to drm_sched_wakeup_if_can_queue()
Date: Thu, 18 May 2023 09:03:24 -0400 [thread overview]
Message-ID: <34ee5d50-d8ac-0ce3-cf60-418ca6888294@amd.com> (raw)
In-Reply-To: <20230517233550.377847-2-luben.tuikov@amd.com>
On 2023-05-17 19:35, Luben Tuikov wrote:
> 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: Luben Tuikov <luben.tuikov@amd.com>
^ ping!
Regards,
Luben
> ---
> drivers/gpu/drm/scheduler/sched_entity.c | 4 ++--
> drivers/gpu/drm/scheduler/sched_main.c | 6 +++---
> include/drm/gpu_scheduler.h | 2 +-
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
> index cfb433e9200586..68e807ae136ad8 100644
> --- a/drivers/gpu/drm/scheduler/sched_entity.c
> +++ b/drivers/gpu/drm/scheduler/sched_entity.c
> @@ -342,7 +342,7 @@ static void drm_sched_entity_wakeup(struct dma_fence *f,
> container_of(cb, struct drm_sched_entity, 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)
> if (drm_sched_policy == DRM_SCHED_POLICY_FIFO)
> 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);
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index 8739322c30321b..b352227a605538 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -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
> *
> + * 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))
> wake_up_interruptible(&sched->wake_up_worker);
> diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
> index 31d1f5166c79fe..e95b4837e5a373 100644
> --- a/include/drm/gpu_scheduler.h
> +++ b/include/drm/gpu_scheduler.h
> @@ -549,7 +549,7 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
> unsigned int num_sched_list);
>
> 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_start(struct drm_gpu_scheduler *sched, bool full_recovery);
> void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched);
next prev parent reply other threads:[~2023-05-18 13:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 23:35 [PATCH 1/2] drm/sched: Rename to drm_sched_can_queue() Luben Tuikov
2023-05-17 23:35 ` [PATCH 2/2] drm/sched: Rename to drm_sched_wakeup_if_can_queue() Luben Tuikov
2023-05-18 13:03 ` Luben Tuikov [this message]
2023-05-19 13:41 ` Alex Deucher
2023-05-31 9:11 ` Christian König
-- strict thread matches above, loose matches on Subject: below --
2023-05-17 23:08 [PATCH 1/2] drm/sched: Rename to drm_sched_can_queue() Luben Tuikov
2023-05-17 23:08 ` [PATCH 2/2] drm/sched: Rename to drm_sched_wakeup_if_can_queue() Luben Tuikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=34ee5d50-d8ac-0ce3-cf60-418ca6888294@amd.com \
--to=luben.tuikov@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox