OSDN Git Service

sched/fair: Fix util_avg of new tasks for asymmetric systems
authorQuentin Perret <quentin.perret@arm.com>
Tue, 12 Jun 2018 11:22:15 +0000 (12:22 +0100)
committerIngo Molnar <mingo@kernel.org>
Sun, 15 Jul 2018 21:51:20 +0000 (23:51 +0200)
commit8fe5c5a937d0f4e84221631833a2718afde52285
tree7818437ed9da8d96da706697214b3e8177b75b72
parentbe45bf5395e0886a93fc816bbe41a008ec2e42e2
sched/fair: Fix util_avg of new tasks for asymmetric systems

When a new task wakes-up for the first time, its initial utilization
is set to half of the spare capacity of its CPU. The current
implementation of post_init_entity_util_avg() uses SCHED_CAPACITY_SCALE
directly as a capacity reference. As a result, on a big.LITTLE system, a
new task waking up on an idle little CPU will be given ~512 of util_avg,
even if the CPU's capacity is significantly less than that.

Fix this by computing the spare capacity with arch_scale_cpu_capacity().

Signed-off-by: Quentin Perret <quentin.perret@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dietmar.eggemann@arm.com
Cc: morten.rasmussen@arm.com
Cc: patrick.bellasi@arm.com
Link: http://lkml.kernel.org/r/20180612112215.25448-1-quentin.perret@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c