summaryrefslogtreecommitdiff
path: root/kernel/sched/sched.h
diff options
context:
space:
mode:
authorMichal Koutný <mkoutny@suse.com>2025-03-10 20:04:36 +0300
committerPeter Zijlstra <peterz@infradead.org>2025-04-08 21:55:53 +0300
commite34e0131fea1b0f63c2105a1958c94af2ee90f4d (patch)
tree4fa9cdf6052340a717e6e991aa86023d47ac0036 /kernel/sched/sched.h
parenta5a25b32c08a31c03258ec4960bec26caaf76e9a (diff)
downloadlinux-e34e0131fea1b0f63c2105a1958c94af2ee90f4d.tar.xz
sched: Add commadline option for RT_GROUP_SCHED toggling
Only simple implementation with a static key wrapper, it will be wired in later. Signed-off-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20250310170442.504716-5-mkoutny@suse.com
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r--kernel/sched/sched.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index c006348102d9..d1e591f91cf8 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1500,6 +1500,23 @@ static inline bool sched_group_cookie_match(struct rq *rq,
}
#endif /* !CONFIG_SCHED_CORE */
+#ifdef CONFIG_RT_GROUP_SCHED
+# ifdef CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED
+DECLARE_STATIC_KEY_FALSE(rt_group_sched);
+static inline bool rt_group_sched_enabled(void)
+{
+ return static_branch_unlikely(&rt_group_sched);
+}
+# else
+DECLARE_STATIC_KEY_TRUE(rt_group_sched);
+static inline bool rt_group_sched_enabled(void)
+{
+ return static_branch_likely(&rt_group_sched);
+}
+# endif /* CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED */
+#else
+# define rt_group_sched_enabled() false
+#endif /* CONFIG_RT_GROUP_SCHED */
static inline void lockdep_assert_rq_held(struct rq *rq)
{