Re: [PATCH 3/3] sched/fair: Propagate runnable_load_avg independently from load_avg

From: Tejun Heo
Date: Fri May 05 2017 - 09:26:16 EST


Hello,

On Fri, May 05, 2017 at 02:18:54PM +0200, Vincent Guittot wrote:
> >> @@ -3354,8 +3367,10 @@ enqueue_entity_load_avg(struct cfs_rq *c
> >> {
> >> struct sched_avg *sa = &se->avg;
> >>
> >> - cfs_rq->avg.runnable_load_avg += sa->load_avg;
> >> - cfs_rq->avg.runnable_load_sum += sa->load_sum;
> >> + if (entity_is_task(se)) {
> >
> > Why don't you add the runnable_load_avg of a group_entity that is enqueued ?
>
> ok, i forgot that you propagate runnable_load_avg in entity now. But
> this seems really weird and adds more exceptions to the normal
> behavior of load tracking

It seems cleaner this way to me. The actual runnable tracking is
taking place for tasks only on their immediate queues and everything
beyond that is pure propagation. The distinction is inherent as
there's no point in calculating runnable for a task's se.

Obviously, we can special-case dequeueing of nested group entities too
but it's more code and fragility.

Thanks.

--
tejun