aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-28 20:11:05 +0100
committerIngo Molnar <mingo@elte.hu>2008-11-28 20:11:05 +0100
commitf1860c34b3ed829ac774647f266abf1074cd58cd (patch)
tree05f368f644c13a21d080ec258393037257e0495f
parent64b7482de253c10efa2589a6212e3d2093a3efc7 (diff)
parent4cd4262034849da01eb88659af677b69f8169f06 (diff)
Merge branch 'sched/urgent' into sched/core
-rw-r--r--kernel/sched.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 338340a3fb8..3d1ee429219 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1433,9 +1433,10 @@ static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd);
static unsigned long cpu_avg_load_per_task(int cpu)
{
struct rq *rq = cpu_rq(cpu);
+ unsigned long nr_running = rq->nr_running;
- if (rq->nr_running)
- rq->avg_load_per_task = rq->load.weight / rq->nr_running;
+ if (nr_running)
+ rq->avg_load_per_task = rq->load.weight / nr_running;
else
rq->avg_load_per_task = 0;