[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-39a4d9ca77a31503c6317e49742341d0859d5cb2@git.kernel.org>
Date: Thu, 8 May 2014 03:44:33 -0700
From: tip-bot for Jason Low <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
torvalds@...ux-foundation.org, peterz@...radead.org,
jason.low2@...com, tglx@...utronix.de
Subject: [tip:sched/core] sched/fair:
Stop searching for tasks in newidle balance if there are runnable tasks
Commit-ID: 39a4d9ca77a31503c6317e49742341d0859d5cb2
Gitweb: http://git.kernel.org/tip/39a4d9ca77a31503c6317e49742341d0859d5cb2
Author: Jason Low <jason.low2@...com>
AuthorDate: Wed, 23 Apr 2014 18:30:35 -0700
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 7 May 2014 13:33:53 +0200
sched/fair: Stop searching for tasks in newidle balance if there are runnable tasks
It was found that when running some workloads (such as AIM7) on large
systems with many cores, CPUs do not remain idle for long. Thus, tasks
can wake/get enqueued while doing idle balancing.
In this patch, while traversing the domains in idle balance, in
addition to checking for pulled_task, we add an extra check for
this_rq->nr_running for determining if we should stop searching for
tasks to pull. If there are runnable tasks on this rq, then we will
stop traversing the domains. This reduces the chance that idle balance
delays a task from running.
This patch resulted in approximately a 6% performance improvement when
running a Java Server workload on an 8 socket machine.
Signed-off-by: Jason Low <jason.low2@...com>
Signed-off-by: Peter Zijlstra <peterz@...radead.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: daniel.lezcano@...aro.org
Cc: alex.shi@...aro.org
Cc: preeti@...ux.vnet.ibm.com
Cc: efault@....de
Cc: vincent.guittot@...aro.org
Cc: morten.rasmussen@....com
Cc: aswin@...com
Cc: chegu_vinod@...com
Link: http://lkml.kernel.org/r/1398303035-18255-4-git-send-email-jason.low2@hp.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/fair.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 051903f..28ccf50 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6713,7 +6713,6 @@ static int idle_balance(struct rq *this_rq)
if (sd->flags & SD_BALANCE_NEWIDLE) {
t0 = sched_clock_cpu(this_cpu);
- /* If we've pulled tasks over stop searching: */
pulled_task = load_balance(this_cpu, this_rq,
sd, CPU_NEWLY_IDLE,
&continue_balancing);
@@ -6728,7 +6727,12 @@ static int idle_balance(struct rq *this_rq)
interval = msecs_to_jiffies(sd->balance_interval);
if (time_after(next_balance, sd->last_balance + interval))
next_balance = sd->last_balance + interval;
- if (pulled_task)
+
+ /*
+ * Stop searching for tasks to pull if there are
+ * now runnable tasks on this rq.
+ */
+ if (pulled_task || this_rq->nr_running > 0)
break;
}
rcu_read_unlock();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists