Skip to content

Commit 1a57319

Browse files
faux123hardkernel
authored andcommitted
kernel:sched: LOAD_FREQ (4*HZ+61) avoids loadavg Moire
LOAD_FREQ is (5*HZ+1) to avoid high load average when idle: http://kerneltrap.org/mailarchive/linux-kernel/2007/10/3/328568 I suggest (4*HZ+61) for a better distribution. With some seconds based load (like SSL heartbeats) and LOAD_FREQ at (5*HZ+1) I see Moire patterns like inverse sawtooth, since 2 or 3 probes hit the jobs (load increases quickly), followed by several probes missing it. A 4.61 sec interval gives optimal distribution over when within a second a probe is taken, as .61 is close to golden ratio phi 1.618... (test in http://ripke.com/goldenratio.c). 12*4.61 = 55.32 secs is still close to a minute, and 13*4.61=59.93 is even closer than the current 12*5.01=60.12 (with exponents EXP_x adjusted to a ratio of 13 instead of 12).
1 parent cc03796 commit 1a57319

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/sched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
123123

124124
#define FSHIFT 11 /* nr of bits of precision */
125125
#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */
126-
#define LOAD_FREQ (5*HZ+1) /* 5 sec intervals */
126+
#define LOAD_FREQ (4*HZ+61) /* 4.61 sec intervals */
127127
#define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point */
128128
#define EXP_5 2014 /* 1/exp(5sec/5min) */
129129
#define EXP_15 2037 /* 1/exp(5sec/15min) */

0 commit comments

Comments
 (0)