Re: [PATCH -v2 13/18] sched/fair: Propagate an effective runnable_load_avg

From: Peter Zijlstra
Date: Tue Oct 03 2017 - 04:50:33 EST


On Mon, Oct 02, 2017 at 06:46:32PM +0100, Dietmar Eggemann wrote:

> > +/*
> > + * Recomputes the group entity based on the current state of its group
> > + * runqueue.
> > + */
> > +static void update_cfs_group(struct sched_entity *se)
>
> update_cfs_share(s)() is still mentioned in the function header of
> update_tg_load_avg() and update_cfs_rq_load_avg().
>
> Should we rename those comments with this patch?
>
> IMHO, the comment for update_tg_load_avg() is still true whereas the one
> for update_cfs_rq_load_avg() mentions cfs_rq->avg as
> cfs_rq->avg.load_avg (or cfs_rq_load_avg()) and update_cfs_group()
> doesn't use it anymore. It's now used in calc_group_runnable() and
> calc_group_shares() instead.
>
> [...]

Right, so something like the below? Thinking that update_cfs_group()
immediately leads to calc_group_*() so no need to spell those out.


diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 350dbec01523..fee2e34812da 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3333,7 +3333,7 @@ __update_load_avg_cfs_rq(u64 now, int cpu, struct cfs_rq *cfs_rq)
* differential update where we store the last value we propagated. This in
* turn allows skipping updates if the differential is 'small'.
*
- * Updating tg's load_avg is necessary before update_cfs_share().
+ * Updating tg's load_avg is necessary before update_cfs_group().
*/
static inline void update_tg_load_avg(struct cfs_rq *cfs_rq, int force)
{
@@ -3601,7 +3601,7 @@ static inline void add_tg_cfs_propagate(struct cfs_rq *cfs_rq, long runnable_sum
* avg. The immediate corollary is that all (fair) tasks must be attached, see
* post_init_entity_util_avg().
*
- * cfs_rq->avg is used for task_h_load() and update_cfs_share() for example.
+ * cfs_rq->avg is used for task_h_load() and update_cfs_group() for example.
*
* Returns true if the load decayed or we removed load.
*