scheduler: Re-compute time-average nr_running on read
authorAlex Frid <afrid@nvidia.com>
Fri, 18 May 2012 19:18:38 +0000 (12:18 -0700)
committerSimone Willett <swillett@nvidia.com>
Sun, 1 Jul 2012 16:15:19 +0000 (09:15 -0700)
commit1802afb2ad9ee1b6c1e11207f3fcdd3a56a1e0f0
treec676684efee743426d8668974797601a1fd93342
parent66df1168a350946cf1f2951371f6d530f1878fe8
scheduler: Re-compute time-average nr_running on read

Re-compute time-average nr_running when it is read. This would
prevent reading stalled average value if there were no run-queue
changes for a long time. New average value is returned to the reader,
but not stored to avoid concurrent writes. Light-weight sequential
counter synchronization is used to assure data consistency for
re-computing average.

Change-Id: I8e4ea1b28ea00b3ddaf6ef7cdcd27866f87d360b
Signed-off-by: Alex Frid <afrid@nvidia.com>
(cherry picked from commit 527a759d9b40bf57958eb002edd2bb82014dab99)
Reviewed-on: http://git-master/r/111637
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Tested-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
kernel/sched.c