diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-28 20:11:05 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-28 20:11:05 +0100 |
commit | f1860c34b3ed829ac774647f266abf1074cd58cd (patch) | |
tree | 05f368f644c13a21d080ec258393037257e0495f /kernel | |
parent | Merge branch 'sched/rt' into sched/core (diff) | |
parent | sched: prevent divide by zero error in cpu_avg_load_per_task (diff) | |
download | linux-f1860c34b3ed829ac774647f266abf1074cd58cd.tar.xz linux-f1860c34b3ed829ac774647f266abf1074cd58cd.zip |
Merge branch 'sched/urgent' into sched/core
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 338340a3fb89..3d1ee429219b 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; |