[RFC PATCH v4 17/28] sched/core: Cgroup v2 support

Yuri Andriaccio posted 28 patches 2 months, 1 week ago
[RFC PATCH v4 17/28] sched/core: Cgroup v2 support
Posted by Yuri Andriaccio 2 months, 1 week ago
From: luca abeni <luca.abeni@santannapisa.it>

Make rt_runtime_us and rt_period_us virtual files accessible also to the
cgroup v2 controller, effectively enabling the RT_GROUP_SCHED mechanism to
cgroups v2.

Signed-off-by: luca abeni <luca.abeni@santannapisa.it>
Signed-off-by: Yuri Andriaccio <yurand2000@gmail.com>
---
 kernel/sched/core.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index bdf1bebe52..6278f203b4 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -10293,6 +10293,18 @@ static struct cftype cpu_files[] = {
 		.write = cpu_uclamp_max_write,
 	},
 #endif /* CONFIG_UCLAMP_TASK_GROUP */
+#ifdef CONFIG_RT_GROUP_SCHED
+	{
+		.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,
+	},
+#endif /* CONFIG_RT_GROUP_SCHED */
 	{ }	/* terminate */
 };
 
-- 
2.51.0
Re: [RFC PATCH v4 17/28] sched/core: Cgroup v2 support
Posted by Juri Lelli 2 weeks, 2 days ago
Hello,

On 01/12/25 13:41, Yuri Andriaccio wrote:
> From: luca abeni <luca.abeni@santannapisa.it>
> 
> Make rt_runtime_us and rt_period_us virtual files accessible also to the
> cgroup v2 controller, effectively enabling the RT_GROUP_SCHED mechanism to
> cgroups v2.
> 
> Signed-off-by: luca abeni <luca.abeni@santannapisa.it>
> Signed-off-by: Yuri Andriaccio <yurand2000@gmail.com>
> ---

Reviewed-by: Juri Lelli <juri.lelli@redhat.com>

Thanks,
Juri