sched: Cure more NO_HZ load average woes
cgroup: speed up access to cgroupfs mounted entries in /proc/mounts

Introduce a new fine-grained lock to protect only the informations
exported to /proc/mounts.

This allows to read /proc/mounts without acquiring the global
cgroup_mutex lock.

Signed-off-by: Andrea Righi <andrea@betterlinux.com>
nohz: Fix stale jiffies update in tick_nohz_restart()

commit 6f103929f8979d2638e58d7f7fda0beefcb8ee7e upstream.

Fix tick_nohz_restart() to not use a stale ktime_t "now" value when
calling tick_do_update_jiffies64(now).

If we reach this point in the loop it means that we crossed a tick
boundary since we grabbed the "now" timestamp, so at this point "now"
refers to a time in the old jiffy, so using the old value for "now" is
incorrect, and is likely to give us a stale jiffies value.

In particular, the first time through the loop the
tick_do_update_jiffies64(now) call is always a no-op, since the
caller, tick_nohz_restart_sched_tick(), will have already called
tick_do_update_jiffies64(now) with that "now" value.

Note that tick_nohz_stop_sched_tick() already uses the correct
approach: when we notice we cross a jiffy boundary, grab a new
timestamp with ktime_get(), and *then* update jiffies.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Cc: Ben Segall <bsegall@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Link: http://lkml.kernel.org/r/1332875377-23014-1-git-send-email-ncardwell@google.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sched: Fix nohz load accounting -- again!

commit c308b56b5398779cd3da0f62ab26b0453494c3d4 upstream.
[ backported to 3.0 by Kerin Millar <kerframil@gmail.com>]

Various people reported nohz load tracking still being wrecked, but Doug
spotted the actual problem. We fold the nohz remainder in too soon,
causing us to loose samples and under-account.

So instead of playing catch-up up-front, always do a single load-fold
with whatever state we encounter and only then fold the nohz remainder
and play catch-up.

Reported-by: Doug Smythies <dsmythies@telus.net>
Reported-by: LesÅ=82aw Kope=C4=87 <leslaw.kopec@nasza-klasa.pl>
Reported-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-4v31etnhgg9kwd6ocgx3rxl8@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Kerin Millar <kerframil@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	kernel/sched.c
Tweak BFQ thanks to franco
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Dont call task_group() many times
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
speed up /proc/stat and optimize vsprintf
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
proc: enhance time-average nr_running stats
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
tmpfs: fix mempolicy object leaks
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Support asynchro compaction in LMK
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Fix mempolicy commit
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Revert "proc: enhance time-average nr_running stats"

This reverts commit c39fd3c2bfa998b3c3068590841bd94938b18930.
Add random entropy tweaks
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>