[RFC PATCH v5 19/29] sched/rt: Remove support for cgroups-v1

Yuri Andriaccio
2026-04-30T21:39:12Z

Disable control files for cgroups-v1, and allow only cgroups-v2.
This should simplify maintaining the code, since cgroups-v1 are deprecated.

Set the default rt-cgroups runtime to zero.
Needed for cgroup-v1 kernels as they wouldn't be able to start
SCHED_DEADLINE tasks. The bandwidth for rt-cgroups must then be manually
assigned after the kernel boots.

Remove cpu_rt_group_init function.

Signed-off-by: Yuri Andriaccio <yurand2000@gmail.com>
---
kernel/sched/core.c | 26 +-------------------------
1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3ffe3ac5071d..41758824b460 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8649,7 +8649,7 @@ void __init sched_init(void)

#ifdef CONFIG_RT_GROUP_SCHED
init_dl_bandwidth(&root_task_group.dl_bandwidth,
- global_rt_period(), global_rt_runtime());
+ global_rt_period(), 0);
#endif /* CONFIG_RT_GROUP_SCHED */

#ifdef CONFIG_CGROUP_SCHED
@@ -9984,20 +9984,6 @@ static struct cftype cpu_legacy_files[] = {
};

#ifdef CONFIG_RT_GROUP_SCHED
-static struct cftype rt_group_files[] = {
- {
- .name = "rt_runtime_us",
- .read_s64 = cpu_rt_runtime_read,
- .write_s64 = cpu_rt_runtime_write,
- },
- {
- .name = "rt_period_us",
- .read_u64 = cpu_rt_period_read_uint,
- .write_u64 = cpu_rt_period_write_uint,
- },
- { } /* Terminate */
-};
-
# ifdef CONFIG_RT_GROUP_SCHED_DEFAULT_DISABLED
DEFINE_STATIC_KEY_FALSE(rt_group_sched);
# else
@@ -10020,16 +10006,6 @@ static int __init setup_rt_group_sched(char *str)
return 1;
}
__setup("rt_group_sched=", setup_rt_group_sched);
-
-static int __init cpu_rt_group_init(void)
-{
- if (!rt_group_sched_enabled())
- return 0;
-
- WARN_ON(cgroup_add_legacy_cftypes(&cpu_cgrp_subsys, rt_group_files));
- return 0;
-}
-subsys_initcall(cpu_rt_group_init);
#endif /* CONFIG_RT_GROUP_SCHED */

static int cpu_extra_stat_show(struct seq_file *sf,
--
2.53.0