diff options
Diffstat (limited to 'kernel/sched.c')
-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 52490bf6b884..7729c4bbc8ba 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1459,9 +1459,10 @@ static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd); | |||
1459 | static unsigned long cpu_avg_load_per_task(int cpu) | 1459 | static unsigned long cpu_avg_load_per_task(int cpu) |
1460 | { | 1460 | { |
1461 | struct rq *rq = cpu_rq(cpu); | 1461 | struct rq *rq = cpu_rq(cpu); |
1462 | unsigned long nr_running = ACCESS_ONCE(rq->nr_running); | ||
1462 | 1463 | ||
1463 | if (rq->nr_running) | 1464 | if (nr_running) |
1464 | rq->avg_load_per_task = rq->load.weight / rq->nr_running; | 1465 | rq->avg_load_per_task = rq->load.weight / nr_running; |
1465 | else | 1466 | else |
1466 | rq->avg_load_per_task = 0; | 1467 | rq->avg_load_per_task = 0; |
1467 | 1468 | ||