aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_fair.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2011-10-03 18:09:01 -0400
committerIngo Molnar <mingo@elte.hu>2011-10-06 06:46:27 -0400
commit6eb57e0d65ebd99a71d435dc96d83e725752eef8 (patch)
tree0349de8e8478a9b39dd1c75d347c36b9ebbef24c /kernel/sched_fair.c
parentca38062e57e97791c2f62e3dbd06caf3ebb5721c (diff)
sched: Request for idle balance during nohz idle load balance
rq's idle_at_tick is set to idle/busy during the timer tick depending on the cpu was idle or not. This will be used later in the load balance that will be done in the softirq context (which is a process context in -RT kernels). For nohz kernels, for the cpu doing nohz idle load balance on behalf of all the idle cpu's, its rq->idle_at_tick might have a stale value (which is recorded when it got the timer tick presumably when it is busy). As the nohz idle load balancing is also being done at the same place as the regular load balancing, nohz idle load balancing was bailing out when it sees rq's idle_at_tick not set. Thus leading to poor system utilization. Rename rq's idle_at_tick to idle_balance and set it when someone requests for nohz idle balance on an idle cpu. Reported-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20111003220934.892350549@sbsiddha-desk.sc.intel.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r--kernel/sched_fair.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 6c5fa1099229..506db0966eb8 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -4676,7 +4676,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu)
4676 if (time_before(now, nohz.next_balance)) 4676 if (time_before(now, nohz.next_balance))
4677 return 0; 4677 return 0;
4678 4678
4679 if (rq->idle_at_tick) 4679 if (idle_cpu(cpu))
4680 return 0; 4680 return 0;
4681 4681
4682 first_pick_cpu = atomic_read(&nohz.first_pick_cpu); 4682 first_pick_cpu = atomic_read(&nohz.first_pick_cpu);
@@ -4712,7 +4712,7 @@ static void run_rebalance_domains(struct softirq_action *h)
4712{ 4712{
4713 int this_cpu = smp_processor_id(); 4713 int this_cpu = smp_processor_id();
4714 struct rq *this_rq = cpu_rq(this_cpu); 4714 struct rq *this_rq = cpu_rq(this_cpu);
4715 enum cpu_idle_type idle = this_rq->idle_at_tick ? 4715 enum cpu_idle_type idle = this_rq->idle_balance ?
4716 CPU_IDLE : CPU_NOT_IDLE; 4716 CPU_IDLE : CPU_NOT_IDLE;
4717 4717
4718 rebalance_domains(this_cpu, idle); 4718 rebalance_domains(this_cpu, idle);