From 7960bc9adb55d2516d1460acb29cb7d8504698b6 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Fri, 20 Apr 2012 16:57:22 +0200 Subject: [PATCH] --- yaml --- r: 304995 b: refs/heads/master c: c22402a2f76e88b04b7a8b6c0597ad9ba6fd71de h: refs/heads/master i: 304993: b7e6b40fb5624a27a1371c619facea3f56da8ee7 304991: 7b4c2e0d5641b967a2a27037c8fa5d8191043044 v: v3 --- [refs] | 2 +- trunk/kernel/sched/fair.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 0211c93a0d74..77a999172ff2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c82513e513556a04f81aa511cd890acd23349c48 +refs/heads/master: c22402a2f76e88b04b7a8b6c0597ad9ba6fd71de diff --git a/trunk/kernel/sched/fair.c b/trunk/kernel/sched/fair.c index 678966ca393b..968ffee24721 100644 --- a/trunk/kernel/sched/fair.c +++ b/trunk/kernel/sched/fair.c @@ -3781,7 +3781,8 @@ static inline void update_sg_lb_stats(struct sched_domain *sd, { unsigned long load, max_cpu_load, min_cpu_load, max_nr_running; int i; - unsigned int balance_cpu = -1, first_idle_cpu = 0; + unsigned int balance_cpu = -1; + unsigned long balance_load = ~0UL; unsigned long avg_load_per_task = 0; if (local_group) @@ -3797,12 +3798,11 @@ static inline void update_sg_lb_stats(struct sched_domain *sd, /* Bias balancing toward cpus of our domain */ if (local_group) { - if (idle_cpu(i) && !first_idle_cpu) { - first_idle_cpu = 1; + load = target_load(i, load_idx); + if (load < balance_load || idle_cpu(i)) { + balance_load = load; balance_cpu = i; } - - load = target_load(i, load_idx); } else { load = source_load(i, load_idx); if (load > max_cpu_load) {