Re: [PATCH 7/6][RFC] sched: unify load_balance{,_newidle}()

From: Peter Zijlstra
Date: Thu Dec 24 2009 - 07:55:55 EST


On Thu, 2009-12-24 at 11:16 +0100, Peter Zijlstra wrote:
> On Thu, 2009-12-24 at 11:09 +0100, Mike Galbraith wrote:
> > On Thu, 2009-12-24 at 10:29 +0100, Peter Zijlstra wrote:
> >
> > > Is that with just this patch applied or also with the next one? I
> > > worried more about the next one.
> >
> > The next one is the troublemaker.
>
> OK, let me re-read all that code with a fresh(er) mind.

Ok, so how does this work for you?

That balance bit comes from update_sg_lb_stats() where it determines
whether or not this cpu is allowed to load balance, it already excepts
CPU_NEWLY_IDLE, even though that up until recently would always have
passed .balance=NULL.

But looking at the code it assumes the called initializes balance to 1,
not 0.

After this we could probably clean this mess up to not check balance but
assume its !NULL.

---
Index: linux-2.6/kernel/sched_fair.c
===================================================================
--- linux-2.6.orig/kernel/sched_fair.c
+++ linux-2.6/kernel/sched_fair.c
@@ -3031,7 +3031,7 @@ static void idle_balance(int this_cpu, s

for_each_domain(this_cpu, sd) {
unsigned long interval;
- int balance = 0;
+ int balance = 1;

if (!(sd->flags & SD_LOAD_BALANCE))
continue;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/