Re: [PATCH 14/18] sched_ext: Split curr|donor references properly

From: Andrea Righi

Date: Wed Sep 16 2026 - 02:47:39 EST


On Thu, Sep 10, 2026 at 01:47:26PM +0200, Peter Zijlstra wrote:
> On Mon, Aug 31, 2026 at 03:42:24PM +0200, Andrea Righi wrote:
>
> > Consider FAIR and EXT tasks with sched_ext running in partial mode. FAIR
> > can be replaced with a higher scheduling class such as RT or deadline
> > without changing the class interaction described here. The possible
> > combinations are:
> >
> > 1. D is EXT, O is EXT, T is EXT
> >
> > D can interrupt T according to BPF scheduling policy. O executes
> > with D's EXT priority and runtime budget, while T waits in EXT.
> >
> > 2. D is EXT, O is EXT, T is FAIR
> >
> > D is visible to the BPF scheduler, but cannot preempt T because
> > EXT is below FAIR. Once T stops, BPF can dispatch D and O executes
> > with D's EXT priority and runtime budget. If T becomes runnable
> > again, it preempts the D/O proxy execution.
> >
> > 3. D is EXT, O is FAIR, T is EXT
> >
> > This cannot represent T preempting O because EXT is below FAIR.
> >
> > 4. D is EXT, O is FAIR, T is FAIR
> >
> > D cannot boost O above T because EXT is below FAIR. O and T
> > continue competing under FAIR. Once O releases M, D wakes and
> > resumes normal EXT scheduling.
> >
> > 5. D is FAIR, O is EXT, T is EXT
> >
> > D preempts T as the higher-class scheduling context. O executes
> > with D's FAIR priority and runtime budget, while T waits in EXT.
> > D is not visible to the BPF scheduler.
> >
> > 6. D is FAIR, O is EXT, T is FAIR
> >
> > D competes with T according to its FAIR deadline. When D is
> > selected, O executes with D's FAIR priority and runtime budget.
> > D is not visible to the BPF scheduler.
> >
> > 7. D is FAIR, O is FAIR, T is EXT
> >
> > This cannot represent T preempting O because EXT is below FAIR.
> >
> > 8. D is FAIR, O is FAIR, T is FAIR
> >
> > O, T, and D all have FAIR scheduling contexts. D remains runnable
> > as a blocked proxy donor. When CFS selects D, O executes using D's
> > FAIR scheduling context. When CFS selects O, O executes using its
> > own FAIR context, and when CFS selects T, T executes normally. D
> > is not visible to the BPF scheduler.
>
> I don't see how 3,4 can happen. If there is a runnable FAIR task, then
> pick will pick that directly.
>
> Per the pick priority, the donor class must always be higher than the
> owner class.
>

Right. I was trying to describe why those cases cannot result in the stated
preemption, but listing them under "possible combinations" made that unclear.
I'll remove those two cases and state this invariant explicitly.

Thanks,
-Andrea