All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] scheduler: rebalance_tick interval update
@ 2004-11-15 22:38 Darren Hart
  2004-11-16  1:17 ` Nick Piggin
  0 siblings, 1 reply; 10+ messages in thread
From: Darren Hart @ 2004-11-15 22:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Nick Piggin, Matt Dobson, Martin J Bligh, Rick Lindsley,
	Andrew Morton, Ingo Molnar

The current rebalance_tick() code assigns each sched_domain's
last_balance field to += interval after performing a load_balance.  If
interval is 10, this has the effect of saying:  we want to run
load_balance at time = 10, 20, 30, 40, etc...  If for example
last_balance=10 and for some reason rebalance_tick can't be run until
30, load_balance will be called and last_balance will be updated to 20,
causing it to call load_balance again immediately the next time it is
called since the interval is 10 and we are already at >30.  It seems to
me that it would make much more sense for last_balance to be assigned
jiffies after a load_balance, then the meaning of last_balance is more
exact: "this domain was last balanced at jiffies" rather than "we last
handled the balance we were supposed to do at 20, at some indeterminate
time".  The following patch makes this change.

Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
---

diff -purN -X /home/mbligh/.diff.exclude /home/linux/views/linux-2.6.10-rc1-mm5/kernel/sched.c linux-2.6.10-rc1-mm5-jni/kernel/sched.c
--- /home/linux/views/linux-2.6.10-rc1-mm5/kernel/sched.c	2004-11-11 05:33:53.000000000 -0800
+++ linux-2.6.10-rc1-mm5-jni/kernel/sched.c	2004-11-15 11:28:16.000000000 -0800
@@ -2201,7 +2201,7 @@ static void rebalance_tick(int this_cpu,
 				/* We've pulled tasks over so no longer idle */
 				idle = NOT_IDLE;
 			}
-			sd->last_balance += interval;
+			sd->last_balance = jiffies;
 		}
 	}
 }



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

end of thread, other threads:[~2004-11-18 16:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-15 22:38 [patch] scheduler: rebalance_tick interval update Darren Hart
2004-11-16  1:17 ` Nick Piggin
2004-11-16  1:53   ` Matthew Dobson
2004-11-16  2:17     ` Nick Piggin
2004-11-16  2:27       ` Nick Piggin
2004-11-16  3:50         ` Darren Hart
2004-11-16  3:51       ` Darren Hart
2004-11-16  7:00       ` Rick Lindsley
     [not found]       ` <1100576400.14742.12.camel@farah.beaverton.ibm.com>
     [not found]         ` <4199957C.1020804@cyberone.com.au>
2004-11-16 15:56           ` Darren Hart
2004-11-18 16:22             ` Darren Hart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.