mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tursulin@ursulin.net>
To: "Philipp Stanner" <phasta@kernel.org>,
	"Danilo Krummrich" <dakr@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>,
	"Tvrtko Ursulin" <tvrtko.ursulin@igalia.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/3] drm/sched: Introduce more locking to entity
Date: Fri, 11 Sep 2026 09:19:16 +0100	[thread overview]
Message-ID: <23c88f50-1998-4de9-bbdb-3d15fd06d642@ursulin.net> (raw)
In-Reply-To: <20260910075942.2000338-2-phasta@kernel.org>


On 10/09/2026 08:59, Philipp Stanner wrote:
> Changes since v2:
>    - Fix ordering bug between spsc_queue_pop() and
>      drm_sched_rq_pop_entity().
> 
> Changes since v1:
>    - Remove a bunch of patches; make this series only about locking
>      entity->last_scheduled. The rest shall be done in separate patches
>      and series. Consequently, also do not lock spsc_queue, yet.
>    - Move lock-cycle patch to first position. (Tvrtko)
> 
> 
> Both Tvrtko [1] and I [2] have recently proposed some improvals for
> drm_sched.
> 
> While taking Tvrtko's feedback into account for my patch, I realized
> that both his and my patch can be fully replaced with a bigger and far
> more beautiful series.
> 
> If I am not mistaken, it turns out that the entire entity->entity_idle
> completion is also nothing but a workaround around the grave mistake of
> not using the greatest helper with parallel programming that exists in
> computer science: Locking.
> 
> This series adds locking to the last_scheduled field and all checks
> related to detect the idleness of the entity. As before, the
> job_scheduled event queue causes the periodic checks.
> 
> This way, we can get rid of memory barriers, RCU, a few lines of code,
> make things more readable, understandable...
> 
> Greetings,
> Philipp
> 
> [1] https://lore.kernel.org/dri-devel/20260611123423.39819-1-tvrtko.ursulin@igalia.com/
> [2] https://lore.kernel.org/dri-devel/20260626081942.2122144-2-phasta@kernel.org/
> 
> Philipp Stanner (3):
>    drm/sched: Lock drm_sched_rq_pop_entity() externally
>    drm/sched: Lock spsc_queue_pop() in drm_sched_entity_pop_job()

FWIW if you could review 
https://lore.kernel.org/dri-devel/20260907130527.52530-1-tvrtko.ursulin@igalia.com/ 
you could drop the first two patches from your series. Extra benefit is 
that patch fixes a bug and has been tested by the user.

Regards,

Tvrtko

>    drm/sched: Protect entity->last_scheduled with spinlock
> 
>   drivers/gpu/drm/scheduler/sched_entity.c | 53 ++++++++++--------------
>   drivers/gpu/drm/scheduler/sched_rq.c     |  4 +-
>   include/drm/gpu_scheduler.h              | 10 ++---
>   3 files changed, 28 insertions(+), 39 deletions(-)
> 


  parent reply	other threads:[~2026-09-11  8:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10  7:59 Philipp Stanner
2026-09-10  7:59 ` [PATCH v3 1/3] drm/sched: Lock drm_sched_rq_pop_entity() externally Philipp Stanner
2026-09-10  7:59 ` [PATCH v3 2/3] drm/sched: Lock spsc_queue_pop() in drm_sched_entity_pop_job() Philipp Stanner
2026-09-10  7:59 ` [PATCH v3 3/3] drm/sched: Protect entity->last_scheduled with spinlock Philipp Stanner
2026-09-11  8:17   ` Tvrtko Ursulin
2026-09-16 12:54     ` Philipp Stanner
2026-09-17  7:22       ` Tvrtko Ursulin
2026-09-16 12:33   ` Christian König
2026-09-11  8:19 ` Tvrtko Ursulin [this message]
2026-09-11 10:34   ` [PATCH v3 0/3] drm/sched: Introduce more locking to entity 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=23c88f50-1998-4de9-bbdb-3d15fd06d642@ursulin.net \
    --to=tursulin@ursulin.net \
    --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=mripard@kernel.org \
    --cc=phasta@kernel.org \
    --cc=simona@ffwll.ch \
    --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®