diff options
author | Michal Koutný <mkoutny@suse.com> | 2025-03-10 20:04:36 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2025-04-08 21:55:53 +0300 |
commit | e34e0131fea1b0f63c2105a1958c94af2ee90f4d (patch) | |
tree | 4fa9cdf6052340a717e6e991aa86023d47ac0036 /kernel/sched/core.c | |
parent | a5a25b32c08a31c03258ec4960bec26caaf76e9a (diff) | |
download | linux-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/core.c')
-rw-r--r-- | kernel/sched/core.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 042c978f7c9b..58d093a8c1af 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -9892,6 +9892,31 @@ static struct cftype cpu_legacy_files[] = { { } /* Terminate */ }; +#ifdef CONFIG_RT_GROUP_SCHED +# ifdef CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED +DEFINE_STATIC_KEY_FALSE(rt_group_sched); +# else +DEFINE_STATIC_KEY_TRUE(rt_group_sched); +# endif + +static int __init setup_rt_group_sched(char *str) +{ + long val; + + if (kstrtol(str, 0, &val) || val < 0 || val > 1) { + pr_warn("Unable to set rt_group_sched\n"); + return 1; + } + if (val) + static_branch_enable(&rt_group_sched); + else + static_branch_disable(&rt_group_sched); + + return 1; +} +__setup("rt_group_sched=", setup_rt_group_sched); +#endif /* CONFIG_RT_GROUP_SCHED */ + static int cpu_extra_stat_show(struct seq_file *sf, struct cgroup_subsys_state *css) { |