summaryrefslogtreecommitdiff
path: root/kernel/sched/ext.c
diff options
context:
space:
mode:
authorAndrea Righi <arighi@nvidia.com>2025-02-14 20:40:04 +0100
committerTejun Heo <tj@kernel.org>2025-02-16 06:52:20 -1000
commitd73249f88743df63a2bdce0e3153369963113710 (patch)
tree66d137741c8a2ab1d2ca978d7f574ba91f135ebb /kernel/sched/ext.c
parentf09177ca5f242a32368a2e9414dce4c90dc1d405 (diff)
sched_ext: idle: Make idle static keys private
Make all the static keys used by the idle CPU selection policy private to ext_idle.c. This avoids unnecessary exposure in headers and improves code encapsulation. Cc: Yury Norov <yury.norov@gmail.com> Signed-off-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/sched/ext.c')
-rw-r--r--kernel/sched/ext.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index aec098efd6fb..7c17e05ed15b 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -4765,7 +4765,7 @@ static void scx_ops_disable_workfn(struct kthread_work *work)
static_branch_disable(&scx_ops_enq_exiting);
static_branch_disable(&scx_ops_enq_migration_disabled);
static_branch_disable(&scx_ops_cpu_preempt);
- static_branch_disable(&scx_builtin_idle_enabled);
+ scx_idle_disable();
synchronize_rcu();
if (ei->kind >= SCX_EXIT_ERROR) {
@@ -5403,12 +5403,7 @@ static int scx_ops_enable(struct sched_ext_ops *ops, struct bpf_link *link)
if (scx_ops.cpu_acquire || scx_ops.cpu_release)
static_branch_enable(&scx_ops_cpu_preempt);
- if (!ops->update_idle || (ops->flags & SCX_OPS_KEEP_BUILTIN_IDLE)) {
- scx_idle_reset_masks();
- static_branch_enable(&scx_builtin_idle_enabled);
- } else {
- static_branch_disable(&scx_builtin_idle_enabled);
- }
+ scx_idle_enable(ops);
/*
* Lock out forks, cgroup on/offlining and moves before opening the