Re: [RFC PATCH v3 07/24] sched/core: Initialize root_task_group
From: Juri Lelli
Date: Thu Oct 02 2025 - 12:33:43 EST
Hello,
On 29/09/25 11:22, Yuri Andriaccio wrote:
> From: luca abeni <luca.abeni@xxxxxxxxxxxxxxx>
>
> Add the initialization function for task_group's dl_servers.
> Initialize the default bandwidth for rt-cgroups and the root control group.
> Add utility functions to check (and get) if a rt_rq entity is connected to a
> real-time cgroup.
It's a bit of a nit, but this patch does quite more than $SUBJECT. So,
I'd say please either reword $SUBJECT or consider splitting it further.
...
> @@ -3077,6 +3078,21 @@ static inline struct rq *rq_of_rt_se(struct sched_rt_entity *rt_se)
> WARN_ON(!rt_group_sched_enabled() && rt_rq->tg != &root_task_group);
> return rt_rq->rq;
> }
> +
> +static inline int is_dl_group(struct rt_rq *rt_rq)
> +{
> + return rt_rq->tg != &root_task_group;
> +}
> +
> +/*
> + * Return the scheduling entity of this group of tasks.
> + */
> +static inline struct sched_dl_entity *dl_group_of(struct rt_rq *rt_rq)
> +{
> + BUG_ON(!is_dl_group(rt_rq));
BUG_ON() should generally be avoided, if possible. Could a
WARN_ON_ONCE() plus returning NULL work here?
> +
> + return rt_rq->tg->dl_se[cpu_of(rt_rq->rq)];
> +}
Thanks,
Juri