diff options
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); | |||
1433 | static unsigned long cpu_avg_load_per_task(int cpu) | 1433 | static unsigned long cpu_avg_load_per_task(int cpu) |
1434 | { | 1434 | { |
1435 | struct rq *rq = cpu_rq(cpu); | 1435 | struct rq *rq = cpu_rq(cpu); |
1436 | unsigned long nr_running = rq->nr_running; | ||
1436 | 1437 | ||
1437 | if (rq->nr_running) | 1438 | if (nr_running) |
1438 | rq->avg_load_per_task = rq->load.weight / rq->nr_running; | 1439 | rq->avg_load_per_task = rq->load.weight / nr_running; |
1439 | else | 1440 | else |
1440 | rq->avg_load_per_task = 0; | 1441 | rq->avg_load_per_task = 0; |
1441 | 1442 | ||