summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-05-02 20:08:52 +0200
committerThomas Gleixner <tglx@linutronix.de>2009-05-15 15:32:45 +0200
commit2d02494f5a90f2e4b3c4c6acc85ec94674cdc431 (patch)
tree8032438de5b55282976583b111d02d9379ff3966 /kernel/sched.c
parentdce48a84adf1806676319f6f480e30a6daa012f9 (diff)
downloadlinux-stable-2d02494f5a90f2e4b3c4c6acc85ec94674cdc431.tar.gz
linux-stable-2d02494f5a90f2e4b3c4c6acc85ec94674cdc431.tar.bz2
linux-stable-2d02494f5a90f2e4b3c4c6acc85ec94674cdc431.zip
sched, timers: cleanup avenrun users
avenrun is an rough estimate so we don't have to worry about consistency of the three avenrun values. Remove the xtime lock dependency and provide a function to scale the values. Cleanup the users. [ Impact: cleanup ] Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c15
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;
unsigned long avenrun[3];
EXPORT_SYMBOL(avenrun);
+/**
+ * get_avenrun - get the load average array
+ * @loads: pointer to dest load array
+ * @offset: offset to add
+ * @shift: shift count to shift the result left
+ *
+ * These values are estimates at best, so no need for locking.
+ */
+void get_avenrun(unsigned long *loads, unsigned long offset, int shift)
+{
+ loads[0] = (avenrun[0] + offset) << shift;
+ loads[1] = (avenrun[1] + offset) << shift;
+ loads[2] = (avenrun[2] + offset) << shift;
+}
+
static unsigned long
calc_load(unsigned long load, unsigned long exp, unsigned long active)
{