Re: [PATCH] sched/rt: move back to RT_GROUP_SCHED and rename it child

From: Steven Rostedt
Date: Tue Aug 01 2023 - 10:03:16 EST


On Tue, 1 Aug 2023 10:00:30 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> On Tue, 1 Aug 2023 14:27:14 +0800
> Yajun Deng <yajun.deng@xxxxxxxxx> wrote:
>
> > @@ -228,13 +228,10 @@ void init_tg_rt_entry(struct task_group *tg, struct rt_rq *rt_rq,
> > if (!rt_se)
> > return;

Ah, I missed the second part of your change log where you said parent is
only NULL when rt_se is NULL.

I would then add:

if (!rt_se)
return;

if (WARN_ON_ONCE(!parent))
return;

-- Steve


> >
> > - if (!parent)
> > - rt_se->rt_rq = &rq->rt;
> > - else
> > - rt_se->rt_rq = parent->my_q;
> > -
> > + rt_se->rt_rq = parent->my_q;
>
> So when this is called with parent = NULL, this will crash?
>
> -- Steve
>
> > rt_se->my_q = rt_rq;
> > rt_se->parent = parent;
> > + parent->child = rt_se;
> > INIT_LIST_HEAD(&rt_se->run_list);
> > }
> >