Re: [PATCH 15/18] sched_ext: Delegate proxy donor admission to BPF schedulers

From: Peter Zijlstra

Date: Thu Sep 10 2026 - 09:56:13 EST


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?