mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Stanner <phasta@mailbox.org>
To: Gyeyoung Baek <gye976@gmail.com>, Tvrtko Ursulin <tursulin@ursulin.net>
Cc: "Tomeu Vizoso" <tomeu@tomeuvizoso.net>,
	"Oded Gabbay" <ogabbay@kernel.org>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	"Philipp Stanner" <phasta@kernel.org>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH] accel/rocket: Parallelize independent jobs across cores
Date: Thu, 03 Dec 2026 10:09:31 +0100	[thread overview]
Message-ID: <b1106df0b2336466d8fd47241951b4d878d4f3db.camel@mailbox.org> (raw)
In-Reply-To: <CAKbEznsUgT=n=eya3gk3d-RTft7FsDh+J2ANh0UNpgN-wgiwSg@mail.gmail.com>

+Cc Christian

On Thu, 2026-12-03 at 13:12 +0900, Gyeyoung Baek wrote:
> > > In general, the problem with why a single entity does not work really is
> > > that drm_sched_entity_select_rq() has this artificial coupling
> > > preventing run queue / scheduler changes while there are queued or
> > > active jobs in the entity. In the ideal world it should work.
> > 
> > Scratch this, I got confused due context switching. One entity shouldn't
> > execute in parallel to itself is fundamental.
> 
> Yes. So an entity alone can't run jobs that don't depend on each other
> concurrently on the cores of hardware like rocket.
> 
> I think drm_sched needs a new queue object, separate from the entity,
> that orders jobs only by their dependencies:
> 
> - An entity orders its jobs in two ways:
>   1. the dependency fences of each job
>   2. the order in which the jobs were queued

I don't think that's a formally correct description. jobs within an
entity are always ordered as FIFO, hence point 2 from your list.

Dependency fences merely determine which entity is runnable.

> 
> - The problem is 2. Because of it, a job waits for the job queued before
>   it even without a dependency, so rocket had to work around it with one
>   entity per core.

Can you elaborate a bit more how your hardware works. So what other
drivers call their ring, for you consists of multiple cores, and each
core can process 1 job in parallel?

If my description above is correct, then it would seem that having one
entity per core is the right thing to do. Or do they then not match the
user(space) queues?

> - 1 can express 2: if each job depends on the previous one, we get 2.
>   So an interface that orders jobs by 1 alone is the more general one.
> 
> I also think drm_sched should provide this, as other multi-core
> accelerators need the same (e.g. the thames driver). I only did it in
> rocket to start small.
> 
> Please let me know if I got anything wrong so far. Otherwise I'll send
> an RFC.

drm_sched is unfortunately not a very stable code base, so if we can
avoid a big rework completely re-conceptualizing the concept of an
entity, that would be kind of nice :(


Thx
Philipp

      reply	other threads:[~2026-12-03  9:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 10:05 Gyeyoung Baek
2026-12-02 14:53 ` Tvrtko Ursulin
2026-12-02 17:27   ` Tvrtko Ursulin
2026-12-03  4:12     ` Gyeyoung Baek
2026-12-03  9:09       ` 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=b1106df0b2336466d8fd47241951b4d878d4f3db.camel@mailbox.org \
    --to=phasta@mailbox.org \
    --cc=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gye976@gmail.com \
    --cc=heiko@sntech.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=ogabbay@kernel.org \
    --cc=phasta@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tomeu@tomeuvizoso.net \
    --cc=tursulin@ursulin.net \
    --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®