aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-07 19:17:38 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-07 19:23:13 -0400
commit0c2043abefacac97b6d01129c1123a466c95b7c1 (patch)
treee1b7bfd3222250fddabec15fc41fd1d2b5eb83dd /include/linux
parent70cb97935b8859f27296772885104b599f560576 (diff)
Don't do load-average calculations at even 5-second intervals
It turns out that there are a few other five-second timers in the kernel, and if the timers get in sync, the load-average can get artificially inflated by events that just happen to coincide. So just offset the load average calculation it by a timer tick. Noticed by Anders Boström, for whom the coincidence started triggering on one of his machines with the JBD jiffies rounding code (JBD is one of the subsystems that also end up using a 5-second timer by default). Tested-by: Anders Boström <anders@bostrom.dyndns.org> Cc: Chuck Ebbert <cebbert@redhat.com> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a01ac6dd5f5e..313c6b6e774f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -113,7 +113,7 @@ extern unsigned long avenrun[]; /* Load averages */
113 113
114#define FSHIFT 11 /* nr of bits of precision */ 114#define FSHIFT 11 /* nr of bits of precision */
115#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ 115#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */
116#define LOAD_FREQ (5*HZ) /* 5 sec intervals */ 116#define LOAD_FREQ (5*HZ+1) /* 5 sec intervals */
117#define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point */ 117#define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point */
118#define EXP_5 2014 /* 1/exp(5sec/5min) */ 118#define EXP_5 2014 /* 1/exp(5sec/5min) */
119#define EXP_15 2037 /* 1/exp(5sec/15min) */ 119#define EXP_15 2037 /* 1/exp(5sec/15min) */