sched/pelt: Fix update_blocked_averages() for RT and DL classes
authorVincent Guittot <vincent.guittot@linaro.org>
Fri, 31 Aug 2018 15:22:55 +0000 (17:22 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 10 Sep 2018 08:13:46 +0000 (10:13 +0200)
commit12b04875d666e83d27511df25580de84505bc758
tree362e668e16a1b16c04d5dac47c78c1a9c512baa0
parente5e96fafd9028b1478b165db78c52d981c14f471
sched/pelt: Fix update_blocked_averages() for RT and DL classes

update_blocked_averages() is called to periodiccally decay the stalled load
of idle CPUs and to sync all loads before running load balance.

When cfs rq is idle, it trigs a load balance during pick_next_task_fair()
in order to potentially pull tasks and to use this newly idle CPU. This
load balance happens whereas prev task from another class has not been put
and its utilization updated yet. This may lead to wrongly account running
time as idle time for RT or DL classes.

Test that no RT or DL task is running when updating their utilization in
update_blocked_averages().

We still update RT and DL utilization instead of simply skipping them to
make sure that all metrics are synced when used during load balance.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 371bf4273269 ("sched/rt: Add rt_rq utilization tracking")
Fixes: 3727e0e16340 ("sched/dl: Add dl_rq utilization tracking")
Link: http://lkml.kernel.org/r/1535728975-22799-1-git-send-email-vincent.guittot@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c