From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: <intel-xe@lists.freedesktop.org>, <matthew.brost@intel.com>
Subject: [PATCH 07/13] drm/sched: Qualify drm_sched_wakeup() by drm_sched_entity_is_ready()
Date: Mon, 11 Dec 2023 14:13:00 -0500 [thread overview]
Message-ID: <20231211191306.1069362-7-rodrigo.vivi@intel.com> (raw)
In-Reply-To: <20231211191306.1069362-1-rodrigo.vivi@intel.com>
From: Luben Tuikov <ltuikov89@gmail.com>
Don't "wake up" the GPU scheduler unless the entity is ready, as well as we
can queue to the scheduler, i.e. there is no point in waking up the scheduler
for the entity unless the entity is ready.
(cherry picked from commit f3123c2590005c5ff631653d31428e40cd10c618)
Signed-off-by: Luben Tuikov <ltuikov89@gmail.com>
Fixes: bc8d6a9df99038 ("drm/sched: Don't disturb the entity when in RR-mode scheduling")
Reviewed-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231110000123.72565-2-ltuikov89@gmail.com
---
drivers/gpu/drm/scheduler/sched_entity.c | 4 ++--
drivers/gpu/drm/scheduler/sched_main.c | 8 +++++---
include/drm/gpu_scheduler.h | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
index f1db63cc8198..4d42b1e4daa6 100644
--- a/drivers/gpu/drm/scheduler/sched_entity.c
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
@@ -370,7 +370,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(entity->rq->sched, entity);
}
/**
@@ -602,7 +602,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(entity->rq->sched, entity);
}
}
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 cd0dc3f81d05..8f5e466bd582 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -925,10 +925,12 @@ static bool drm_sched_can_queue(struct drm_gpu_scheduler *sched)
*
* Wake up the scheduler if we can queue jobs.
*/
-void drm_sched_wakeup(struct drm_gpu_scheduler *sched)
+void drm_sched_wakeup(struct drm_gpu_scheduler *sched,
+ struct drm_sched_entity *entity)
{
- if (drm_sched_can_queue(sched))
- drm_sched_run_job_queue(sched);
+ if (drm_sched_entity_is_ready(entity))
+ if (drm_sched_can_queue(sched))
+ drm_sched_run_job_queue(sched);
}
/**
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
index 43730f1ecbfd..b838a3e53040 100644
--- a/include/drm/gpu_scheduler.h
+++ b/include/drm/gpu_scheduler.h
@@ -558,7 +558,7 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched);
void drm_sched_job_cleanup(struct drm_sched_job *job);
-void drm_sched_wakeup(struct drm_gpu_scheduler *sched);
+void drm_sched_wakeup(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity);
bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched);
void drm_sched_wqueue_stop(struct drm_gpu_scheduler *sched);
void drm_sched_wqueue_start(struct drm_gpu_scheduler *sched);
--
2.43.0
next prev parent reply other threads:[~2023-12-11 19:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 19:12 [PATCH 01/13] drm/sched: Rename drm_sched_get_cleanup_job to be more descriptive Rodrigo Vivi
2023-12-11 19:12 ` [PATCH 02/13] drm/sched: Move free worker re-queuing out of the if block Rodrigo Vivi
2023-12-11 19:12 ` [PATCH 03/13] drm/sched: Rename drm_sched_free_job_queue to be more descriptive Rodrigo Vivi
2023-12-11 19:12 ` [PATCH 04/13] drm/sched: Rename drm_sched_run_job_queue_if_ready and clarify kerneldoc Rodrigo Vivi
2023-12-11 19:12 ` [PATCH 05/13] drm/sched: Drop suffix from drm_sched_wakeup_if_can_queue Rodrigo Vivi
2023-12-11 19:12 ` [PATCH 06/13] drm/sched: Don't disturb the entity when in RR-mode scheduling Rodrigo Vivi
2023-12-11 19:13 ` Rodrigo Vivi [this message]
2023-12-11 19:13 ` [PATCH 08/13] drm/sched: implement dynamic job-flow control Rodrigo Vivi
2023-12-11 19:13 ` [PATCH 09/13] drm/sched: Fix bounds limiting when given a malformed entity Rodrigo Vivi
2023-12-11 19:13 ` [PATCH 10/13] drm/sched: Rename priority MIN to LOW Rodrigo Vivi
2023-12-11 19:13 ` [PATCH 11/13] drm/sched: Reverse run-queue priority enumeration Rodrigo Vivi
2023-12-11 19:13 ` [PATCH 12/13] drm/sched: Partial revert of "Qualify drm_sched_wakeup() by drm_sched_entity_is_ready()" Rodrigo Vivi
2023-12-11 19:13 ` [PATCH 13/13] fixup! drm/xe: Introduce a new DRM driver for Intel GPUs Rodrigo Vivi
2023-12-11 21:25 ` Matthew Brost
2023-12-11 20:17 ` ✓ CI.Patch_applied: success for series starting with [01/13] drm/sched: Rename drm_sched_get_cleanup_job to be more descriptive Patchwork
2023-12-11 20:17 ` ✗ CI.checkpatch: warning " Patchwork
2023-12-11 20:18 ` ✓ CI.KUnit: success " Patchwork
2023-12-11 20:26 ` ✓ CI.Build: " Patchwork
2023-12-11 20:26 ` ✓ CI.Hooks: " Patchwork
2023-12-11 20:27 ` ✓ CI.checksparse: " Patchwork
2023-12-11 21:03 ` ✓ CI.BAT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2023-12-12 0:10 [PATCH 01/13] " Rodrigo Vivi
2023-12-12 0:10 ` [PATCH 07/13] drm/sched: Qualify drm_sched_wakeup() by drm_sched_entity_is_ready() Rodrigo Vivi
2023-12-08 20:27 [PATCH 01/13] drm/sched: Rename drm_sched_get_cleanup_job to be more descriptive Rodrigo Vivi
2023-12-08 20:27 ` [PATCH 07/13] drm/sched: Qualify drm_sched_wakeup() by drm_sched_entity_is_ready() Rodrigo Vivi
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=20231211191306.1069362-7-rodrigo.vivi@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
/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