sched: Reduce overestimating rq->avg_idle

When updating avg_idle, if the delta exceeds some max value, then
avg_idle
gets set to the max, regardless of what the previous avg was. This can
cause
avg_idle to often be overestimated.

This patch modifies the way we update avg_idle by always updating it
with the
function call to update_avg() first. Then, if avg_idle exceeds the max,
we set
it to the max.

Signed-off-by: Jason Low <jason.low2@hp.com>
Reviewed-by: Rik van Riel <riel@redhat.com>

Signed-off-by: Paul Reioux <reioux@gmail.com>
af_unix: speedup /proc/net/unix /proc/net/unix has quadratic behavior…

…, and can hold unix_table_lock for a while if high number of unix
sockets are alive. (90 ms for 200k sockets...)

We already have a hash table, so its quite easy to use it.

Problem is unbound sockets are still hashed in a single hash slot
(unix_socket_table[UNIX_HASH_TABLE])

This patch also spreads unbound sockets to 256 hash slots, to speedup
both /proc/net/unix and unix_diag.

Time to read /proc/net/unix with 200k unix sockets :
(time dd if=/proc/net/unix of=/dev/null bs=4k)

before : 520 secs
after : 2 secs

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: flar2 <asegaert@gmail.com>
sched/cpuidle: reduce IPI store. Backport upstream 3.16 scheduler upd…

…ates

Signed-off-by: Paul Reioux <reioux@gmail.com>
sched/fair: Optimize find_busiest_queue()

Use for_each_cpu_and() and thereby avoid computing the capacity for
CPUs we know we're not interested in.

Reviewed-by: Paul Turner <pjt@google.com>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-lppceyv6kb3a19g8spmrn20b@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul Reioux <reioux@gmail.com>

backported for Linux 3.4
ramfs: fix zram activation
GE: back to normal IR
tty: Fix high cpu load if tty is unreleaseable

commit 37b164578826406a173ca7c20d9ba7430134d23e upstream.

Kernel oops can cause the tty to be unreleaseable (for example, if
n_tty_read() crashes while on the read_wait queue). This will cause
tty_release() to endlessly loop without sleeping.

Use a killable sleep timeout which grows by 2n+1 jiffies over the
interval
[0, 120 secs.) and then jumps to forever (but still killable).

NB: killable just allows for the task to be rewoken manually, not
to be terminated.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ramfs: show stock voltage values for CPU & GPU
Revert "sched: enable ARCH_POWER feature"

This reverts commit 435ef0b9e17ac30dc791c586a6015623ef44a3b3.
ramfs: collect stock voltage values before settings get applied
1.2.1 b2