Re: [PATCH 15/18] sched_ext: Delegate proxy donor admission to BPF schedulers
From: Andrea Righi
Date: Wed Sep 16 2026 - 02:51:44 EST
On Thu, Sep 10, 2026 at 03:39:00PM +0200, Peter Zijlstra wrote:
> On Mon, Aug 31, 2026 at 03:42:25PM +0200, Andrea Righi wrote:
>
> > diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
> > index 5f4956cf7e369..aa6ba9e8d7cb0 100644
> > --- a/kernel/sched/ext/ext.c
> > +++ b/kernel/sched/ext/ext.c
> > @@ -26,7 +26,28 @@ DEFINE_RAW_SPINLOCK(scx_sched_lock);
> >
> > bool scx_allow_proxy_exec(const struct task_struct *p)
> > {
> > - return p->sched_class != &ext_sched_class;
> > + struct scx_sched *sch;
> > +
> > + if (p->sched_class != &ext_sched_class)
> > + return true;
> > +
> > + sch = scx_task_sched(p);
> > + return !sch || (sch->ops.flags & SCX_OPS_ENQ_BLOCKED);
> > +}
>
> Can we have this thing either be inline or wrapped in an inline function
> that has scx_enabled() on?
>
Yes, that makes sense. This is called from the scheduler blocking path, so the
inactive sched_ext case should be handled through the scx_enabled() static key.
I'll add an inline scx_allow_proxy_exec() wrapper that returns true when
sched_ext is disabled and calls __scx_allow_proxy_exec() otherwise.
Thanks,
-Andrea