diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-02 20:09:50 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-02 20:09:50 +0100 |
commit | a64d31baed104be25305e9c71585d3ea4ee9a418 (patch) | |
tree | 470e3c59ef39f38bcd69f8fef7dba8f76afbec53 /kernel/sched.c | |
parent | sched: convert struct root_domain to cpumask_var_t, fix (diff) | |
parent | Linux 2.6.28-rc7 (diff) | |
download | linux-a64d31baed104be25305e9c71585d3ea4ee9a418.tar.xz linux-a64d31baed104be25305e9c71585d3ea4ee9a418.zip |
Merge branch 'linus' into cpus4096
Conflicts:
kernel/trace/ring_buffer.c
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 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); static unsigned long cpu_avg_load_per_task(int cpu) { struct rq *rq = cpu_rq(cpu); + unsigned long nr_running = ACCESS_ONCE(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; |