Re: [PATCH] accel/rocket: Parallelize independent jobs across cores
From: Philipp Stanner
Date: Thu Dec 03 2026 - 04:09:41 EST
+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