sched_ext: Merge adjacent ifdefs in ext.h
Subsystems (2)
PATCH 1/1 sched_ext: Merge adjacent ifdefs in ext.h
Commit 6a1cda143c23 ("sched_ext: Always use SMP versions in kernel/sched/ext.h") dropped the CONFIG_SMP guard from scx_update_idle(), leaving two adjacent CONFIG_SCHED_CLASS_EXT blocks.
Merge the declaration and stub into the primary ifdef block. No functional change.
Signed-off-by Cheng-Yang Chou <[email protected]>
--- kernel/sched/ext/ext.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
kernel/sched/ext/ext.h +8 -12
@@ -21,6 +21,13 @@ 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 ); +void __scx_update_idle (struct rq *rq,bool idle,bool do_notify); + +static inline void scx_update_idle (struct rq *rq,bool idle,bool do_notify) +{ +if (scx_enabled ()) +__scx_update_idle (rq, idle, do_notify); +}static inline u32 scx_cpuperf_target (s32 cpu) {
@@ -55,21 +62,10 @@ static inline int scx_check_setscheduler(struct task_struct *p, int policy) { restatic inline bool task_on_scx (const struct task_struct *p) {return false; }static inline bool scx_allow_ttwu_queue (const struct task_struct *p) {return true; }static inline void init_sched_ext_class (void ) {} +static inline void scx_update_idle (struct rq *rq,bool idle,bool do_notify) {}#endif /* CONFIG_SCHED_CLASS_EXT */ -#ifdef CONFIG_SCHED_CLASS_EXT -void __scx_update_idle (struct rq *rq,bool idle,bool do_notify); - -static inline void scx_update_idle (struct rq *rq,bool idle,bool do_notify) -{ -if (scx_enabled ()) -__scx_update_idle (rq, idle, do_notify); -} -#else -static inline void scx_update_idle (struct rq *rq,bool idle,bool do_notify) {} -#endif -#ifdef CONFIG_CGROUP_SCHED #ifdef CONFIG_EXT_GROUP_SCHED void scx_tg_init (struct task_group *tg);
Signature · 1 line
2.43.0
Hello,
Applied to sched_ext/for-7.4.
Thanks.
Signature · 1 line
tejun