Re: [PATCHSET sched_ext/for-6.15] sched_ext: Enhance built-in idle selection with preferred CPUs

Tejun Heo
2025-03-06T18:34:16Z

Hello,

On Thu, Mar 06, 2025 at 07:18:03PM +0100, Andrea Righi wrote:
> To implement this, introduce a new helper kfunc scx_bpf_select_cpu_pref()
> that allows to specify a cpumask of preferred CPUs:
>
> s32 scx_bpf_select_cpu_pref(struct task_struct *p,
> const struct cpumask *preferred_cpus,
> s32 prev_cpu, u64 wake_flags, u64 flags);
>
> Moreover, introduce the new idle flag %SCX_PICK_IDLE_IN_PREF that can be
> used to enforce selection strictly within the preferred domain.

Would something like scx_bpf_select_cpu_and() work which is only allowed
pick in the intersection (ie. always SCX_PICK_IDLE_IN_PREF). I'm not sure
how much more beneficial a built-in two-level mechanism is especially given
that it wouldn't be too uncommon to need multi-level pick - e.g. within l3
then within numa node and so on.

Thanks.

--
tejun