Re: [PATCH 09/10] sched,fair: add helper functions for flattened runqueue

From: Rik van Riel
Date: Mon Jul 01 2019 - 16:53:47 EST


On Mon, 2019-07-01 at 16:20 -0400, Josef Bacik wrote:
>
>
> > +static unsigned long task_se_h_weight(struct sched_entity *se)
> > +{
> > + struct cfs_rq *cfs_rq;
> > +
> > + if (!task_se_in_cgroup(se))
> > + return se->load.weight;
> > +
> > + cfs_rq = group_cfs_rq_of_parent(se);
> > + update_cfs_rq_h_load(cfs_rq);
> > +
> > + /* Reduce the load.weight by the h_load of the group the task
> > is in. */
> > + return (cfs_rq->h_load * se->load.weight) >>
> > SCHED_FIXEDPOINT_SHIFT;
>
> This should be
>
> scale_load_down(cfs_rq->h_load * se->load.weight);

That may be the same mathematically, but it is
different conceptually.

If we convert CFS to have full load resolution with
cgroups (which we probably want), then scale_load_down
becomes a noop, while this shift continues doing the
right thing.

--
All Rights Reversed.

Attachment: signature.asc
Description: This is a digitally signed message part