diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index f4eb88153bd1..497c09ba61e7 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2868,6 +2868,21 @@ static unsigned long calc_load_update; | |||
2868 | unsigned long avenrun[3]; | 2868 | unsigned long avenrun[3]; |
2869 | EXPORT_SYMBOL(avenrun); | 2869 | EXPORT_SYMBOL(avenrun); |
2870 | 2870 | ||
2871 | /** | ||
2872 | * get_avenrun - get the load average array | ||
2873 | * @loads: pointer to dest load array | ||
2874 | * @offset: offset to add | ||
2875 | * @shift: shift count to shift the result left | ||
2876 | * | ||
2877 | * These values are estimates at best, so no need for locking. | ||
2878 | */ | ||
2879 | void get_avenrun(unsigned long *loads, unsigned long offset, int shift) | ||
2880 | { | ||
2881 | loads[0] = (avenrun[0] + offset) << shift; | ||
2882 | loads[1] = (avenrun[1] + offset) << shift; | ||
2883 | loads[2] = (avenrun[2] + offset) << shift; | ||
2884 | } | ||
2885 | |||
2871 | static unsigned long | 2886 | static unsigned long |
2872 | calc_load(unsigned long load, unsigned long exp, unsigned long active) | 2887 | calc_load(unsigned long load, unsigned long exp, unsigned long active) |
2873 | { | 2888 | { |