linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: fix updating sd->balance_interval in idle_balance()
@ 2010-05-19 23:45 Nikhil Rao
  2010-05-20  7:16 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Rao @ 2010-05-19 23:45 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Mike Galbraith
  Cc: Venkatesh Pallipadi, linux-kernel, Nikhil Rao

sd->balance_interval is updated incorrectly when SD_BALANCE_NEWIDLE is not set
in sd->flags. This patch updates sd->balance_interval only when we balance the
domain.

Signed-off-by: Nikhil Rao <ncrao@google.com>
---
 kernel/sched_fair.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 217e4a9..c35fe47 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -2996,11 +2996,12 @@ static void idle_balance(int this_cpu, struct rq *this_rq)
 		if (!(sd->flags & SD_LOAD_BALANCE))
 			continue;
 
-		if (sd->flags & SD_BALANCE_NEWIDLE) {
-			/* If we've pulled tasks over stop searching: */
-			pulled_task = load_balance(this_cpu, this_rq,
-						   sd, CPU_NEWLY_IDLE, &balance);
-		}
+		if (!(sd->flags & SD_BALANCE_NEWIDLE))
+			continue;
+
+		/* If we've pulled tasks over stop searching: */
+		pulled_task = load_balance(this_cpu, this_rq, sd,
+					   CPU_NEWLY_IDLE, &balance);
 
 		interval = msecs_to_jiffies(sd->balance_interval);
 		if (time_after(next_balance, sd->last_balance + interval))
-- 
1.7.0.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sched: fix updating sd->balance_interval in idle_balance()
  2010-05-19 23:45 [PATCH] sched: fix updating sd->balance_interval in idle_balance() Nikhil Rao
@ 2010-05-20  7:16 ` Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2010-05-20  7:16 UTC (permalink / raw)
  To: Nikhil Rao; +Cc: Ingo Molnar, Mike Galbraith, Venkatesh Pallipadi, linux-kernel

On Wed, 2010-05-19 at 16:45 -0700, Nikhil Rao wrote:
> sd->balance_interval is updated incorrectly when SD_BALANCE_NEWIDLE is not set
> in sd->flags. This patch updates sd->balance_interval only when we balance the
> domain. 

I really need more than that.

Why is it wrong, what are the (measurable) effects of changing it and
how did it come to be this way.

I could of course go and try to reverse engineer your patch, but it
would be awesome if I didn't have to.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-20  7:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 23:45 [PATCH] sched: fix updating sd->balance_interval in idle_balance() Nikhil Rao
2010-05-20  7:16 ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).