[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <80debf449017604657abd9086d81b8cfc0e0ad5e.camel@surriel.com>
Date: Wed, 26 Jun 2019 12:15:05 -0400
From: Rik van Riel <riel@...riel.com>
To: Dietmar Eggemann <dietmar.eggemann@....com>, peterz@...radead.org
Cc: mingo@...hat.com, linux-kernel@...r.kernel.org, kernel-team@...com,
morten.rasmussen@....com, tglx@...utronix.de,
mgorman@...hsingularity.com, vincent.guittot@...aro.org
Subject: Re: [PATCH 5/8] sched,cfs: use explicit cfs_rq of parent se helper
On Wed, 2019-06-26 at 17:58 +0200, Dietmar Eggemann wrote:
> On 6/12/19 9:32 PM, Rik van Riel wrote:
> > Use an explicit "cfs_rq of parent sched_entity" helper in a few
> > strategic places, where cfs_rq_of(se) may no longer point at the
> > right runqueue once we flatten the hierarchical cgroup runqueues.
> >
> > No functional change.
> >
> > Signed-off-by: Rik van Riel <riel@...riel.com>
> > ---
> > kernel/sched/fair.c | 17 +++++++++++++----
> > 1 file changed, 13 insertions(+), 4 deletions(-)
> >
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index dcc521d251e3..c6ede2ecc935 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -275,6 +275,15 @@ static inline struct cfs_rq
> > *group_cfs_rq(struct sched_entity *grp)
> > return grp->my_q;
> > }
> >
> > +/* runqueue owned by the parent entity */
> > +static inline struct cfs_rq *group_cfs_rq_of_parent(struct
> > sched_entity *se)
> > +{
> > + if (se->parent)
> > + return group_cfs_rq(se->parent);
> > +
> > + return &cfs_rq_of(se)->rq->cfs;
>
> The function name and the description is not 100% correct. For tasks
> running naturally (not in a flattened taskgroup) in the root
> taskgroup
> or for the se representing a first level taskgroup (e.g. /tg1 (with
> se->depth = 0)) it returns the root cfs_rq or easier se->cfs_rq.
>
> So you could replace
>
> return &cfs_rq_of(se)->rq->cfs;
>
> with
>
> return se->cfs_rq;
>
> or
>
> return cfs_rq_of(se);
Good point. I will do that for the v2 series.
--
All Rights Reversed.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists