Re: [PATCH v7 2/3] sched/fair: Remove task_group->se pointer array
From: K Prateek Nayak
Date: Mon Jan 19 2026 - 01:43:23 EST
Hello Zecheng,
On 1/18/2026 9:04 AM, Zecheng Li wrote:
> @@ -2201,6 +2200,26 @@ struct cfs_tg_state {
> struct sched_entity se;
> struct sched_statistics stats;
> } __no_randomize_layout;
> +
> +static inline struct sched_entity *tg_se(struct task_group *tg, int cpu)
> +{
> + if (is_root_task_group(tg))
> + return NULL;
> +
> + struct cfs_tg_state *state =
nit. Can you move the declaration of "struct cfs_tg_state *state" to the
top of the function. Same for cfs_rq_se().
> + container_of(tg->cfs_rq[cpu], struct cfs_tg_state, cfs_rq);
> + return &state->se;
> +}
> +
> +static inline struct sched_entity *cfs_rq_se(struct cfs_rq *cfs_rq)
> +{
> + if (is_root_task_group(cfs_rq->tg))
> + return NULL;
> +
> + struct cfs_tg_state *state =
> + container_of(cfs_rq, struct cfs_tg_state, cfs_rq);
> + return &state->se;
> +}
> #endif
--
Thanks and Regards,
Prateek