aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2012-09-13 00:11:26 -0400
committerIngo Molnar <mingo@kernel.org>2012-09-13 10:52:03 -0400
commit5ed4f1d96deee82ee92cd1ac1e0108c27e80e9b0 (patch)
treeb147faa700337a1ab47a321f2e35016946b77a16 /kernel/sched
parent38b8dd6f87398524d02c21ff614c507ba8c9d295 (diff)
sched: Fix nohz_idle_balance()
On tickless systems, one CPU runs load balance for all idle CPUs. The cpu_load of this CPU is updated before starting the load balance of each other idle CPUs. We should instead update the cpu_load of the balance_cpu. Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Venkatesh Pallipadi <venki@google.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Link: http://lkml.kernel.org/r/1347509486-8688-1-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/fair.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 1ca4fe423528..9ae3a5b68ba4 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4794,14 +4794,15 @@ static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle)
4794 if (need_resched()) 4794 if (need_resched())
4795 break; 4795 break;
4796 4796
4797 raw_spin_lock_irq(&this_rq->lock); 4797 rq = cpu_rq(balance_cpu);
4798 update_rq_clock(this_rq); 4798
4799 update_idle_cpu_load(this_rq); 4799 raw_spin_lock_irq(&rq->lock);
4800 raw_spin_unlock_irq(&this_rq->lock); 4800 update_rq_clock(rq);
4801 update_idle_cpu_load(rq);
4802 raw_spin_unlock_irq(&rq->lock);
4801 4803
4802 rebalance_domains(balance_cpu, CPU_IDLE); 4804 rebalance_domains(balance_cpu, CPU_IDLE);
4803 4805
4804 rq = cpu_rq(balance_cpu);
4805 if (time_after(this_rq->next_balance, rq->next_balance)) 4806 if (time_after(this_rq->next_balance, rq->next_balance))
4806 this_rq->next_balance = rq->next_balance; 4807 this_rq->next_balance = rq->next_balance;
4807 } 4808 }