aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 3f5bfdc3d94d..8050a61a7adb 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1439,9 +1439,10 @@ static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd);
1439static unsigned long cpu_avg_load_per_task(int cpu) 1439static unsigned long cpu_avg_load_per_task(int cpu)
1440{ 1440{
1441 struct rq *rq = cpu_rq(cpu); 1441 struct rq *rq = cpu_rq(cpu);
1442 unsigned long nr_running = ACCESS_ONCE(rq->nr_running);
1442 1443
1443 if (rq->nr_running) 1444 if (nr_running)
1444 rq->avg_load_per_task = rq->load.weight / rq->nr_running; 1445 rq->avg_load_per_task = rq->load.weight / nr_running;
1445 else 1446 else
1446 rq->avg_load_per_task = 0; 1447 rq->avg_load_per_task = 0;
1447 1448