From: Linus Torvalds Date: Sun, 7 Oct 2007 23:17:38 +0000 (-0700) Subject: Don't do load-average calculations at even 5-second intervals X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c2043abefacac97b6d01129c1123a466c95b7c1;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Cc: Chuck Ebbert Cc: Arjan van de Ven Cc: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/sched.h b/include/linux/sched.h index a01ac6dd5f5..313c6b6e774 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -113,7 +113,7 @@ extern unsigned long avenrun[]; /* Load averages */ #define FSHIFT 11 /* nr of bits of precision */ #define FIXED_1 (1<