[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aP-XAGrWQY1d6Bq9@slm.duckdns.org>
Date: Mon, 27 Oct 2025 06:00:00 -1000
From: Tejun Heo <tj@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: David Vernet <void@...ifault.com>,
Andrea Righi <andrea.righi@...ux.dev>,
Changwoo Min <changwoo@...lia.com>, linux-kernel@...r.kernel.org,
sched-ext@...ts.linux.dev, Wen-Fang Liu <liuwenfang@...or.com>
Subject: Re: [PATCH 3/3] sched_ext: Allow scx_bpf_reenqueue_local() to be
called from anywhere
Hello,
On Mon, Oct 27, 2025 at 10:18:22AM +0100, Peter Zijlstra wrote:
...
> > The main use case for cpu_release() was calling scx_bpf_reenqueue_local() when
> > a CPU gets preempted by a higher priority scheduling class. However, the old
> > scx_bpf_reenqueue_local() could only be called from cpu_release() context.
>
> I'm a little confused. Isn't this the problem where balance_one()
> migrates a task to the local rq and we end up having to RETRY_TASK
> because another (higher) rq gets modified?
That's what I thought too and the gap between balance() and pick_task() can
be closed that way. However, while plugging that, I realized there's another
bigger gap between ttwu() and pick_task() because ttwu() can directly
dispatch a task into the local DSQ of a CPU. That one, there's no way to
close without a global hook.
> Why can't we simply re-queue the task in the RETRY_TASK branch --
> effectively undoing balance_one()?
>
> Relying on hooking into tracepoints seems like a gruesome hack.
>From a BPF scheduler's POV, it's just using a more generic mechanism.
Multiple schedulers already make use of other BPF attach points - timers,
TPs, fentry/fexit's, so this doesn't make things less congruent.
Thanks.
--
tejun
Powered by blists - more mailing lists