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)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 19:13:17 +0000 (12:13 -0700)
commit1e64005830b6d9f25c5829763a5e36dd94ed683f
tree80ebcafb40e5c9974bd2ce6ed03c7a00290dcedc
parent39817b1c135bc34de65624f53680637ee06b67b5
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

Rebase-Id: Re0ca57c84a644e8e2d474930379cdcc386a2135a
kernel/sched/core.c
kernel/sched/sched.h