Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched_ext: Relocate scx_enabled() related code

scx_enabled() will be used in scx_rq_clock_update/invalidate()
in the following patch, so relocate the scx_enabled() related code
to the proper location.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Changwoo Min and committed by
Tejun Heo
ea9b2626 a73bca3d

+13 -13
+13 -13
kernel/sched/sched.h
··· 1717 1717 1718 1718 extern struct balance_callback balance_push_callback; 1719 1719 1720 + #ifdef CONFIG_SCHED_CLASS_EXT 1721 + extern const struct sched_class ext_sched_class; 1722 + 1723 + DECLARE_STATIC_KEY_FALSE(__scx_ops_enabled); /* SCX BPF scheduler loaded */ 1724 + DECLARE_STATIC_KEY_FALSE(__scx_switched_all); /* all fair class tasks on SCX */ 1725 + 1726 + #define scx_enabled() static_branch_unlikely(&__scx_ops_enabled) 1727 + #define scx_switched_all() static_branch_unlikely(&__scx_switched_all) 1728 + #else /* !CONFIG_SCHED_CLASS_EXT */ 1729 + #define scx_enabled() false 1730 + #define scx_switched_all() false 1731 + #endif /* !CONFIG_SCHED_CLASS_EXT */ 1732 + 1720 1733 /* 1721 1734 * Lockdep annotation that avoids accidental unlocks; it's like a 1722 1735 * sticky/continuous lockdep_assert_held(). ··· 2517 2504 extern const struct sched_class rt_sched_class; 2518 2505 extern const struct sched_class fair_sched_class; 2519 2506 extern const struct sched_class idle_sched_class; 2520 - 2521 - #ifdef CONFIG_SCHED_CLASS_EXT 2522 - extern const struct sched_class ext_sched_class; 2523 - 2524 - DECLARE_STATIC_KEY_FALSE(__scx_ops_enabled); /* SCX BPF scheduler loaded */ 2525 - DECLARE_STATIC_KEY_FALSE(__scx_switched_all); /* all fair class tasks on SCX */ 2526 - 2527 - #define scx_enabled() static_branch_unlikely(&__scx_ops_enabled) 2528 - #define scx_switched_all() static_branch_unlikely(&__scx_switched_all) 2529 - #else /* !CONFIG_SCHED_CLASS_EXT */ 2530 - #define scx_enabled() false 2531 - #define scx_switched_all() false 2532 - #endif /* !CONFIG_SCHED_CLASS_EXT */ 2533 2507 2534 2508 /* 2535 2509 * Iterate only active classes. SCX can take over all fair tasks or be