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

From: Peter Zijlstra

Date: Thu Sep 10 2026 - 11:06:34 EST


On Mon, Aug 31, 2026 at 03:42:25PM +0200, Andrea Righi wrote:

> +/*
> + * End retained proxy execution before changing @p's BPF scheduler ownership.
> + * Called with @p's pi and rq locks held immediately before
> + * sched_change_begin(). The caller must pass DEQUEUE_NOCLOCK so the rq clock
> + * is updated only once.
> + */
> +void scx_prepare_task_sched_change(struct task_struct *p)
> +{
> + lockdep_assert_held(&p->pi_lock);
> + lockdep_assert_rq_held(task_rq(p));
> +
> + update_rq_clock(task_rq(p));
> + sched_proxy_block_task(task_rq(p), p);
> }
>
> /*

> @@ -8027,6 +8108,14 @@ static void scx_root_enable_workfn(struct kthread_work *work)
>
> if (old_class != new_class)
> queue_flags |= DEQUEUE_CLASS;
> + if (old_class == new_class && new_class == &ext_sched_class) {
> + /*
> + * This is an EXT-to-EXT scheduler ownership change, so
> + * sched_change_begin() won't end retained proxy execution.
> + */
> + scx_prepare_task_sched_change(p);

Here, see, this is what I was expecting for this thing. Just have it be
always instead of for ext-ext only.