]> git.baikalelectronics.ru Git - kernel.git/commit
sched: fix stale value in average load per task
authorBalbir Singh <balbir@linux.vnet.ibm.com>
Wed, 12 Nov 2008 10:49:00 +0000 (16:19 +0530)
committerIngo Molnar <mingo@elte.hu>
Wed, 12 Nov 2008 11:33:50 +0000 (12:33 +0100)
commit203b95c8397838cecf7e915e9a7330658669c65a
tree52fb05ee2d63765ddddcf4a2e06f310510607735
parentc3249cc19d3b856751d42ba1b2d8cf46ccb24d2e
sched: fix stale value in average load per task

Impact: fix load balancer load average calculation accuracy

cpu_avg_load_per_task() returns a stale value when nr_running is 0.
It returns an older stale (caculated when nr_running was non zero) value.

This patch returns and sets rq->avg_load_per_task to zero when nr_running
is 0.

Compile and boot tested on a x86_64 box.

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c