Re: [PATCH 3/3] sched_ext: Allow scx_bpf_reenqueue_local() to be called from anywhere
From: Tejun Heo
Date: Tue Oct 28 2025 - 13:07:18 EST
Hello, Peter.
On Tue, Oct 28, 2025 at 12:01:53PM +0100, Peter Zijlstra wrote:
> On Mon, Oct 27, 2025 at 08:17:38AM -1000, Tejun Heo wrote:
> > Hello,
> >
> > On Mon, Oct 27, 2025 at 07:10:28PM +0100, Peter Zijlstra wrote:
> > ...
> > > Just for my elucidation and such.. This is when ttwu() happens and the
> > > CPU is idle and you dispatch directly to it, expecting it to then go run
> > > that task. After which another wakeup/balance movement happens which
> > > places/moves a task from a higher priority class to that CPU, such that
> > > your initial (ext) task doesn't get to run after all. Right?
> >
> > Yes, that's the scenario that I was thinking.
>
> So I've been pondering this a bit, and came up with the below. I'm not
> quite happy with it, I meant to share that new queue_mask variable, but
> this came out.
Yeah, something like this that creates global state tracking from wakeup to
dispatch would work. However, from sched_ext POV, I think TP route probably
is a better route at least for now. Once reenqueue_local is allowed from
anywhere, which is useful no matter what, there just aren't good reasons to
maintain ops.cpu_acuire/release(). It doesn't allow anything more or make
things noticeably more performant or easier. It's always nice to be able to
reduce API surface after all.
Thanks.
--
tejun