diff options
| author | Tejun Heo <tj@kernel.org> | 2025-04-09 09:06:00 -1000 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2025-04-09 09:06:00 -1000 |
| commit | 743354e3bb7238552cda70a5f39ba6e946a899fd (patch) | |
| tree | 3dc509045c34aef6f706b1fd559392fb112d18c8 /kernel/sched/ext.h | |
| parent | 54d2e717bc5f419b111915adfdec7ecc1ca8cf90 (diff) | |
sched_ext: Remove scx_ops_allow_queued_wakeup static_key
scx_ops_allow_queued_wakeup is used to encode SCX_OPS_ALLOW_QUEUED_WAKEUP
into a static_key. The test is gated behind scx_enabled(), and, even when
sched_ext is enabled, is unlikely for the static_key usage to make any
meaningful difference. It is made to use a static_key mostly because there
was no reason not to. However, global static_keys can't work with the
planned hierarchical multiple scheduler support. Remove the static_key and
instead test SCX_OPS_ALLOW_QUEUED_WAKEUP directly.
In repeated hackbench runs before and after static_keys removal on an AMD
Ryzen 3900X, I couldn't tell any measurable performance difference.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Changwoo Min <changwoo@igalia.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Diffstat (limited to 'kernel/sched/ext.h')
| -rw-r--r-- | kernel/sched/ext.h | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/kernel/sched/ext.h b/kernel/sched/ext.h index 1bda96b19a1b..3053cdd61eb9 100644 --- a/kernel/sched/ext.h +++ b/kernel/sched/ext.h @@ -21,6 +21,7 @@ void scx_rq_activate(struct rq *rq); void scx_rq_deactivate(struct rq *rq); int scx_check_setscheduler(struct task_struct *p, int policy); bool task_should_scx(int policy); +bool scx_allow_ttwu_queue(const struct task_struct *p); void init_sched_ext_class(void); static inline u32 scx_cpuperf_target(s32 cpu) @@ -36,13 +37,6 @@ static inline bool task_on_scx(const struct task_struct *p) return scx_enabled() && p->sched_class == &ext_sched_class; } -static inline bool scx_allow_ttwu_queue(const struct task_struct *p) -{ - return !scx_enabled() || - static_branch_likely(&scx_ops_allow_queued_wakeup) || - p->sched_class != &ext_sched_class; -} - #ifdef CONFIG_SCHED_CORE bool scx_prio_less(const struct task_struct *a, const struct task_struct *b, bool in_fi); |