Re: [RFC PATCH v5 18/29] sched/core: Cgroup v2 support
From: luca abeni
Date: Wed May 06 2026 - 15:58:19 EST
Hi Peter,
On Tue, 5 May 2026 16:59:22 +0200
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Thu, Apr 30, 2026 at 11:38:22PM +0200, Yuri Andriaccio wrote:
> > From: luca abeni <luca.abeni@xxxxxxxxxxxxxxx>
> >
> > 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.
>
> Can we have a blub about why only strict periodic servers; eg. why no
> sporadic? and such...
Maybe I am misunderstanding your question, anyway: the file is called
"rt_runtime_us", but the scheduling algorithm used to schedule the
cgroup is SCHED_DEADLINE.
So, we do not use a strictly periodic server, but a CBS, that can also
support sporadic / non-periodic activations.
Luca
>
> > Signed-off-by: luca abeni <luca.abeni@xxxxxxxxxxxxxxx>
> > Signed-off-by: Yuri Andriaccio <yurand2000@xxxxxxxxx>
> > ---
> > kernel/sched/core.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index 0c7032d254ba..3ffe3ac5071d 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -10245,6 +10245,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.53.0
> >