From: Philipp Stanner <phasta@mailbox.org>
To: "Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Philipp Stanner" <phasta@kernel.org>,
"Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
Tomeu Vizoso <tomeu@tomeuvizoso.net>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/4] drm/sched: limit sched score update to jobs change
Date: Thu, 06 Nov 2025 10:50:43 +0100 [thread overview]
Message-ID: <7317df627873853cfd2b91e5d2452ca1a9433a42.camel@mailbox.org> (raw)
In-Reply-To: <20251106093933.18859-4-pierre-eric.pelloux-prayer@amd.com>
nit: s/limit/Limit
On Thu, 2025-11-06 at 10:39 +0100, Pierre-Eric Pelloux-Prayer wrote:
> Currently, the scheduler score is incremented when a job is pushed to an
> entity and when an entity is attached to the scheduler.
>
> This leads to some bad scheduling decision where the score value is
> largely made of idle entities.
>
> For instance, a scenario with 2 schedulers and where 10 entities submit
> a single job, then do nothing, each scheduler will probably end up with
> a score of 5.
> Now, 5 userspace apps exit, so their entities will be dropped. In
s/Now,/Now, let's imagine
> the worst case, these apps' entities where all attached to the same
s/where/were
> scheduler and we end up with score=5 (the 5 remaining entities) and
> score=0, despite the 2 schedulers being idle.
> When new entities show up, they will all select the second scheduler
> based on its low score value, instead of alternating between the 2.
>
> Some amdgpu rings depended on this feature, but the previous commit
> implemented the same thing in amdgpu directly so it can be safely
> removed from drm/sched.
>
> Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
> Acked-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
With the commit message fixed up a little bit:
Acked-by: Philipp Stanner <phasta@kernel.org
Apply how you want :)
P.
> ---
> drivers/gpu/drm/scheduler/sched_main.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index c39f0245e3a9..8a3d99a86090 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -206,7 +206,6 @@ void drm_sched_rq_add_entity(struct drm_sched_rq *rq,
> if (!list_empty(&entity->list))
> return;
>
> - atomic_inc(rq->sched->score);
> list_add_tail(&entity->list, &rq->entities);
> }
>
> @@ -228,7 +227,6 @@ void drm_sched_rq_remove_entity(struct drm_sched_rq *rq,
>
> spin_lock(&rq->lock);
>
> - atomic_dec(rq->sched->score);
> list_del_init(&entity->list);
>
> if (rq->current_entity == entity)
prev parent reply other threads:[~2025-11-06 9:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 9:39 [PATCH v3 1/4] drm/amdgpu: add engine_retains_context to amdgpu_ring_funcs Pierre-Eric Pelloux-Prayer
2025-11-06 9:39 ` [PATCH v3 2/4] drm/amdgpu: jump to the correct label on failure Pierre-Eric Pelloux-Prayer
2025-11-06 9:56 ` Tvrtko Ursulin
2025-11-06 10:21 ` Christian König
2025-11-07 9:05 ` Pierre-Eric Pelloux-Prayer
2025-11-06 9:39 ` [PATCH v3 3/4] drm/amdgpu: increment sched score on entity selection Pierre-Eric Pelloux-Prayer
2025-11-06 10:00 ` Tvrtko Ursulin
2025-11-06 10:10 ` Pierre-Eric Pelloux-Prayer
2025-11-06 10:23 ` Tvrtko Ursulin
2025-11-06 9:39 ` [PATCH v3 4/4] drm/sched: limit sched score update to jobs change Pierre-Eric Pelloux-Prayer
2025-11-06 9:50 ` Philipp Stanner [this message]
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=7317df627873853cfd2b91e5d2452ca1a9433a42.camel@mailbox.org \
--to=phasta@mailbox.org \
--cc=airlied@gmail.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=phasta@kernel.org \
--cc=pierre-eric.pelloux-prayer@amd.com \
--cc=simona@ffwll.ch \
--cc=tomeu@tomeuvizoso.net \
--cc=tvrtko.ursulin@igalia.com \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®