scheduler: Re-compute time-average nr_running on read
authorVarun Wadekar <vwadekar@nvidia.com>
Wed, 11 Jul 2012 08:58:06 +0000 (13:58 +0530)
committerVarun Wadekar <vwadekar@nvidia.com>
Thu, 12 Jul 2012 04:42:17 +0000 (09:42 +0530)
commit94cb4c90a3fc0b311c74e6d48e5e04650d50a2dd
tree715823964c3a61a0a394f735853dc81821794072
parent5a164d915cea2876b81a3ea278ab315e6cdf9703
scheduler: Re-compute time-average nr_running on read

Port commit 1802afb2a (http://git-master/r/111637) from v3.1

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.

Original author: Alex Frid <afrid@nvidia.com>

Signed-off-by: Alex Frid <afrid@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

Change-Id: Ic486006d62436fb61cda4ab6897e933f5c102b52
kernel/sched/core.c
kernel/sched/sched.h