On 09/08/2016 04:17 PM, Leo Yan wrote:
When wake up task, the CPU selection is heavily relying on CPU utilization. But in some cases before the CPU enter idle state, its utilization is a high value and it will not be updated during CPU's idle state. So this will introduce misunderstanding when select CPU.
This patch is to update idle CPUs utilization value until the value is decayed to 0. And because after the CPU enter idle state, it has no any task on its run queue, so should not introduce big load when iterate cfs rq's hierarchy.
Signed-off-by: Leo Yan leo.yan@linaro.org
kernel/sched/fair.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e0b50ca..8e8767b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5955,6 +5955,12 @@ static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync) sg = sd->groups; sg_target = sg;
/* update idle CPUs utilization */
for_each_online_cpu(i) {
if (idle_cpu(i) && cpu_util(i))
update_blocked_averages(i);
}
if (sysctl_sched_is_big_little) { /*
update_blocked_averages() call in wakeup path is probably a little bit too harsh. Wasn't working on something which does the updates in load-balance context? In this case we should focus exploring this possibility because I guess it has more change to get mainlined. IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.