Re: [PATCH -v2 03/18] sched/fair: Cure calc_cfs_shares() vs reweight_entity()

From: Peter Zijlstra
Date: Fri Sep 29 2017 - 07:39:08 EST


On Fri, Sep 29, 2017 at 10:04:34AM +0100, Morten Rasmussen wrote:

> > - load = scale_load_down(cfs_rq->load.weight);
> > + load = max(scale_load_down(cfs_rq->load.weight), cfs_rq->avg.load_avg);
>
> We use cfs_rq->tg_load_avg_contrib (the filtered version of
> cfs_rq->avg.load_avg) instead of cfs_rq->avg.load_avg further down, so I
> think we should here too for consistency.
>
> + load = max(scale_load_down(cfs_rq->load.weight),
> + cfs_rq->tg_load_avg_contrib);
>

No; we must use tg_load_avg_contrib because that is what's inclded in
tg_weight, but we want to add the most up-to-date value back in.