lkml.org 
[lkml]   [2009]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 7/6][RFC] sched: unify load_balance{,_newidle}()
From
Date
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;



\
 
 \ /
  Last update: 2009-12-24 13:59    [W:0.030 / U:20.636 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site