This source file includes following definitions.
- calc_load
1
2 #ifndef _LINUX_SCHED_LOADAVG_H
3 #define _LINUX_SCHED_LOADAVG_H
4
5
6
7
8
9
10
11
12
13
14
15 extern unsigned long avenrun[];
16 extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
17
18 #define FSHIFT 11
19 #define FIXED_1 (1<<FSHIFT)
20 #define LOAD_FREQ (5*HZ+1)
21 #define EXP_1 1884
22 #define EXP_5 2014
23 #define EXP_15 2037
24
25
26
27
28 static inline unsigned long
29 calc_load(unsigned long load, unsigned long exp, unsigned long active)
30 {
31 unsigned long newload;
32
33 newload = load * exp + active * (FIXED_1 - exp);
34 if (active >= load)
35 newload += FIXED_1-1;
36
37 return newload / FIXED_1;
38 }
39
40 extern unsigned long calc_load_n(unsigned long load, unsigned long exp,
41 unsigned long active, unsigned int n);
42
43 #define LOAD_INT(x) ((x) >> FSHIFT)
44 #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
45
46 extern void calc_global_load(unsigned long ticks);
47
48 #endif