]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sched_ext: idle: Consolidate default idle CPU selection kfuncs
authorAndrea Righi <arighi@nvidia.com>
Wed, 21 May 2025 07:34:06 +0000 (09:34 +0200)
committerTejun Heo <tj@kernel.org>
Wed, 21 May 2025 17:35:48 +0000 (07:35 -1000)
commita730e3f7a48bc591bfa838c5d922e5a80ea51738
treebe03892f2e3eba8ca5866738738cca2814d2c105
parente764295a270ce733820681bada131238ab2eb81b
sched_ext: idle: Consolidate default idle CPU selection kfuncs

There is no reason to restrict scx_bpf_select_cpu_dfl() invocations to
ops.select_cpu() while allowing scx_bpf_select_cpu_and() to be used from
multiple contexts, as both provide equivalent functionality, with the
latter simply accepting an additional "allowed" cpumask.

Therefore, unify the two APIs, enabling both kfuncs to be used from
ops.select_cpu(), ops.enqueue(), and unlocked contexts (e.g., via BPF
test_run).

This allows schedulers to implement a consistent idle CPU selection
policy and helps reduce code duplication.

Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext_idle.c