From: Philipp Stanner <phasta@mailbox.org>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
phasta@kernel.org, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Cc: kernel-dev@igalia.com,
"Christian König" <christian.koenig@amd.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Matthew Brost" <matthew.brost@intel.com>
Subject: Re: [PATCH 01/28] drm/sched: Reverse drm_sched_rq_init arguments
Date: Fri, 10 Oct 2025 12:36:47 +0200 [thread overview]
Message-ID: <084ffa0dea3f2bc8d0ca2f15e90f46f10ecd49a0.camel@mailbox.org> (raw)
In-Reply-To: <1785ebaf-776a-4717-9922-3aa0c31d0d52@igalia.com>
On Fri, 2025-10-10 at 10:46 +0100, Tvrtko Ursulin wrote:
>
> On 10/10/2025 09:55, Philipp Stanner wrote:
> > On Wed, 2025-10-08 at 09:53 +0100, Tvrtko Ursulin wrote:
> > > Helper operates on the run queue so lets make that the primary argument.
> > >
> > > 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>
> > > ---
> > > drivers/gpu/drm/scheduler/sched_main.c | 8 ++++----
> > > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > That's a new patch from the RFC, isn't it?
> >
> > And it's a general code improvement that is not related to CFS. I think
> > I mentioned it a few times already that a series is easier to review
> > and workflows are simplified if generic-improvement patches are
> > branched out and sent separately.
> >
> > I thought you had agreed with that?
>
> Hm not sure. My workflow is definitely easier if this work is a single
> unit throughout.
>
> Anyway, with this change it still far from consistency, so how much of
> an improvement it brings is open to debate. The general idea is that
> functions in sched_rq.c operate on sched_rq, which is the first
> argument, and by the end of the series the second argument disappears:
>
> void drm_sched_rq_init(struct drm_sched_rq *rq)
> {
> spin_lock_init(&rq->lock);
> INIT_LIST_HEAD(&rq->entities);
> rq->rb_tree_root = RB_ROOT_CACHED;
> rq->head_prio = -1;
> }
>
> int drm_sched_init(struct drm_gpu_scheduler *sched, const struct
> drm_sched_init_args *args)
> {
> ...
> drm_sched_rq_init(&sched->rq);
>
> But again, even at that point the code base is still not fully
> consistent in this respect aka needs more work. Not least you recently
> asked to rename drm_sched_rq_select_entity(rq) to
> drm_sched_select_entity(sched). So maybe you disagree with this patch
> completely and would prefer drm_sched_rq_init(sched). I don't know.
> Anyway, if you r-b it is trivial to send separately and merge. Or if you
> disapprove I will just drop this patch and rebase.
I think it's best to drop it for now and address such things in a
separate series one day for style and consistency changes which
hopefully sets it completely straight.
I had something like that on my list, too, for all the docstrings which
are inconsistent.
P.
>
> Regards,
>
> Tvrtko
>
> > > diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> > > index 46119aacb809..8b8c55b25762 100644
> > > --- a/drivers/gpu/drm/scheduler/sched_main.c
> > > +++ b/drivers/gpu/drm/scheduler/sched_main.c
> > > @@ -174,13 +174,13 @@ void drm_sched_rq_update_fifo_locked(struct drm_sched_entity *entity,
> > > /**
> > > * drm_sched_rq_init - initialize a given run queue struct
> > > *
> > > + * @rq: scheduler run queue
> > > * @sched: scheduler instance to associate with this run queue
> > > - * @rq: scheduler run queue
> > > *
> > > * Initializes a scheduler runqueue.
> > > */
> > > -static void drm_sched_rq_init(struct drm_gpu_scheduler *sched,
> > > - struct drm_sched_rq *rq)
> > > +static void drm_sched_rq_init(struct drm_sched_rq *rq,
> > > + struct drm_gpu_scheduler *sched)
> > > {
> > > spin_lock_init(&rq->lock);
> > > INIT_LIST_HEAD(&rq->entities);
> > > @@ -1353,7 +1353,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, const struct drm_sched_init_
> > > sched->sched_rq[i] = kzalloc(sizeof(*sched->sched_rq[i]), GFP_KERNEL);
> > > if (!sched->sched_rq[i])
> > > goto Out_unroll;
> > > - drm_sched_rq_init(sched, sched->sched_rq[i]);
> > > + drm_sched_rq_init(sched->sched_rq[i], sched);
> > > }
> > >
> > > init_waitqueue_head(&sched->job_scheduled);
> >
>
next prev parent reply other threads:[~2025-10-10 12:37 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 8:53 [PATCH 00/28] Fair DRM scheduler Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 01/28] drm/sched: Reverse drm_sched_rq_init arguments Tvrtko Ursulin
2025-10-10 8:55 ` Philipp Stanner
2025-10-10 9:46 ` Tvrtko Ursulin
2025-10-10 10:36 ` Philipp Stanner [this message]
2025-10-11 13:21 ` Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 02/28] drm/sched: Add some scheduling quality unit tests Tvrtko Ursulin
2025-10-10 9:38 ` Philipp Stanner
2025-10-11 13:09 ` Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 03/28] drm/sched: Add some more " Tvrtko Ursulin
2025-10-10 9:48 ` Philipp Stanner
2025-10-11 13:21 ` Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 04/28] drm/sched: Implement RR via FIFO Tvrtko Ursulin
2025-10-10 10:18 ` Philipp Stanner
2025-10-11 13:30 ` Tvrtko Ursulin
2025-10-14 6:40 ` Philipp Stanner
2025-10-08 8:53 ` [PATCH 05/28] drm/sched: Consolidate entity run queue management Tvrtko Ursulin
2025-10-10 10:49 ` Philipp Stanner
2025-10-11 14:19 ` Tvrtko Ursulin
2025-10-14 6:53 ` Philipp Stanner
2025-10-14 7:26 ` Tvrtko Ursulin
2025-10-14 8:52 ` Philipp Stanner
2025-10-14 10:04 ` Tvrtko Ursulin
2025-10-14 11:23 ` Philipp Stanner
2025-10-08 8:53 ` [PATCH 06/28] drm/sched: Move run queue related code into a separate file Tvrtko Ursulin
2025-10-08 22:49 ` Matthew Brost
2025-10-08 8:53 ` [PATCH 07/28] drm/sched: Free all finished jobs at once Tvrtko Ursulin
2025-10-08 22:48 ` Matthew Brost
2025-10-08 8:53 ` [PATCH 08/28] drm/sched: Account entity GPU time Tvrtko Ursulin
2025-10-10 12:22 ` Philipp Stanner
2025-10-11 14:56 ` Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 09/28] drm/sched: Remove idle entity from tree Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 10/28] drm/sched: Add fair scheduling policy Tvrtko Ursulin
2025-10-14 10:27 ` Philipp Stanner
2025-10-14 12:56 ` Tvrtko Ursulin
2025-10-14 14:02 ` Philipp Stanner
2025-10-14 14:32 ` Simona Vetter
2025-10-14 14:58 ` Tvrtko Ursulin
2025-10-16 7:06 ` Philipp Stanner
2025-10-16 8:42 ` Tvrtko Ursulin
2025-10-16 9:50 ` Danilo Krummrich
2025-10-16 10:54 ` Tvrtko Ursulin
2025-10-16 11:14 ` Danilo Krummrich
2025-10-08 8:53 ` [PATCH 11/28] drm/sched: Favour interactive clients slightly Tvrtko Ursulin
2025-10-14 10:53 ` Philipp Stanner
2025-10-14 12:20 ` Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 12/28] drm/sched: Switch default policy to fair Tvrtko Ursulin
2025-10-10 12:56 ` Philipp Stanner
2025-10-08 8:53 ` [PATCH 13/28] drm/sched: Remove FIFO and RR and simplify to a single run queue Tvrtko Ursulin
2025-10-14 11:16 ` Philipp Stanner
2025-10-14 13:16 ` Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 14/28] drm/sched: Embed run queue singleton into the scheduler Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 15/28] accel/amdxdna: Remove drm_sched_init_args->num_rqs usage Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 16/28] accel/rocket: " Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 17/28] drm/amdgpu: " Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 18/28] drm/etnaviv: " Tvrtko Ursulin
2025-10-08 10:31 ` Christian Gmeiner
2025-10-08 8:53 ` [PATCH 19/28] drm/imagination: " Tvrtko Ursulin
2025-10-10 14:29 ` Matt Coster
2025-10-08 8:53 ` [PATCH 20/28] drm/lima: " Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 21/28] drm/msm: " Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 22/28] drm/nouveau: " Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 23/28] drm/panfrost: " Tvrtko Ursulin
2025-10-08 14:55 ` Steven Price
2025-10-08 8:53 ` [PATCH 24/28] drm/panthor: " Tvrtko Ursulin
2025-10-08 14:55 ` Steven Price
2025-10-10 10:02 ` Liviu Dudau
2025-10-08 8:53 ` [PATCH 25/28] drm/sched: " Tvrtko Ursulin
2025-10-08 22:44 ` Matthew Brost
2025-10-08 8:53 ` [PATCH 26/28] drm/v3d: " Tvrtko Ursulin
2025-10-10 14:15 ` Melissa Wen
2025-10-08 8:53 ` [PATCH 27/28] drm/xe: " Tvrtko Ursulin
2025-10-08 8:53 ` [PATCH 28/28] drm/sched: Remove drm_sched_init_args->num_rqs Tvrtko Ursulin
2025-10-10 13:00 ` Philipp Stanner
2025-10-11 14:58 ` Tvrtko Ursulin
2025-10-10 8:59 ` [PATCH 00/28] Fair DRM scheduler Philipp Stanner
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=084ffa0dea3f2bc8d0ca2f15e90f46f10ecd49a0.camel@mailbox.org \
--to=phasta@mailbox.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=matthew.brost@intel.com \
--cc=phasta@kernel.org \
--cc=tvrtko.ursulin@igalia.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