]> git.hungrycats.org Git - linux/commit
[PATCH] sched: handle inter-CPU jiffies skew
authorAndrew Morton <akpm@osdl.org>
Mon, 10 May 2004 06:24:49 +0000 (23:24 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 10 May 2004 06:24:49 +0000 (23:24 -0700)
commitdb05a1928343866f8f52ab6eaf8e5acd9af4e8e3
treeb0c9342e98e0a41194d789470442f9b398c546d4
parente18e19ade9a0c0334cf8a2bc1945d97ec1697061
[PATCH] sched: handle inter-CPU jiffies skew

From: Nick Piggin <piggin@cyberone.com.au>

John Hawkes discribed this problem to me:

There *is* a small problem in this area, though, that SuSE avoids.
"jiffies" gets updated by cpu0.  The other CPUs may, over time, get out of
sync (and they're initialized on ia64 to start out being out of sync), so
it's no guarantee that every CPU will wake up from its timer interrupt and
see a "jiffies" value that is guaranteed to be last_jiffies+1.  Sometimes
the jiffies value may be unchanged since the last wakeup.  Sometimes the
jiffies value may have incremented by 2 (or more, especially if cpu0's
interrupts are disabled for long stretches of time).  So an algoithm that
says, "I'll call load_balance() only when jiffies is *exactly* N" is going
to fail on occasion, either by calling load_balance() too often or not
often enough.  ***

I fixed this by adding a last_balance field to struct sched_domain, and
working off that.
include/linux/sched.h
kernel/sched.c