Revert "block: Switch from BFQ-v6r1 for 3.1.0 to BFQ-v6r2 for 3.1.0."

This reverts commit 78d0266781ff5c2e0e8593931f6c1ec905c79110.

Change-Id: I7d75940c372b0bd7162f94469510246e342fe894
Revert "block: Switch from BFQ-v6 for 3.1.0 to BFQ-v6r1 for 3.1.0."

This reverts commit a56a03e00a41b128b777615797f47d46414fe1cf.

Change-Id: I16514f3508b6694cfe99d3ca1dc0e336ff27509a
Revert "block: Switch from BFQ-v5r1 for 3.1.0 to BFQ-v6 for 3.1.0."

This reverts commit f020f265d1c8c8102277fc6e9a16f21967133c61.

Change-Id: I1cfbfef2b4d4faaa8173f440dd3b66ea11c5e198
Revert "block: Switch from BFQ-v5 for 3.1.0 to BFQ-v5r1 for 3.1.0."

This reverts commit 37b88f05f60353e5cec5193f086f0f07d9e0ca48.

Change-Id: Iafd6bbe221c7a913e58f2e5f35cc37e2327df4aa
Revert "Merge remote-tracking branch 'github/cm-10.1' into cm-10.2-merge"

This reverts commit fa81c2194208661de88dc21263b117ec7070329f.

Change-Id: I10e84966c375f606b89e2bdf765e1d0e8c645d65
Patch1:block-prepare-I-O-context-code-for-BFQ-v7r2-for-3.1

Change-Id: I2653fb04dfed73d73f2eb581d3bfd3b73dc6037f
Patch2:block-cgroups-kconfig-build-bits-for-BFQ-v7r2-3.1

Change-Id: Ia30ef2b9654ec302f99dbd2a6e14ba96d7664c22
Patch3:block-introduce-the-BFQ-v7r2-I-O-sched-for-3.1

Change-Id: I7f502e89ae16da722d81646c5d48bb6502e0251e
Patch4:block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r2-for-3.1.0

Change-Id: I24ebb8cc444b397c1ff64fc9b257cb118d814f67
Make BFQ I/O default
See latest results here:
http://www.algogroup.unimo.it/people/paolo/disk_sched/results.php

Change-Id: Ic6c8785f8e9b345ee0c6a5e08af0d27f2a5e88f1
tmpfs: fix mempolicy object leaks
This patch fixes several mempolicy leaks in the tmpfs mount logic.
These leaks are slow - on the order of one object leaked per mount
attempt.

Leak 1 (umount doesn't free mpol allocated in mount):
    while true; do
        mount -t tmpfs -o mpol=interleave,size=100M nodev /mnt
        umount /mnt
    done

Leak 2 (errors parsing remount options will leak mpol):
    mount -t tmpfs -o size=100M nodev /mnt
    while true; do
        mount -o remount,mpol=interleave,size=x /mnt 2> /dev/null
    done
    umount /mnt

Leak 3 (multiple mpol per mount leak mpol):
    while true; do
        mount -t tmpfs -o mpol=interleave,mpol=interleave,size=100M nodev /mnt
        umount /mnt
    done

This patch fixes all of the above.  I could have broken the patch into
three pieces but is seemed easier to review as one.

Signed-off-by: Greg Thelen <gthelen@google.com>
modified for Mako kernel from LKML reference

Change-Id: I3e21c87d9b262626e3283a813b8cf78c5f6be34a
Signed-off-by: faux123 <reioux@gmail.com>
lib/rwsem.c: steal writing sem for better performance fixed for 3.0.y

rwsem: steal writing sem for better performance
Commit 5a50508 changes to rwsem from mutex, caused aim7 fork_test
performance to dropped 50%. Yuanhan liu did an analysis, found it was
caused by strict sequential writing. Ingo suggest stealing sem writing from
front task in wait queue. https://lkml.org/lkml/2013/1/29/84

So does this patch.
In this patch, I just allow write stealing to happen when the first waiter
is also writer. The performance fully is now fully recovered.

Reported-by: lkp@linux.intel.com
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Alex Shi <alex.shi@intel.com>

lib/rwsem.c: fix compatibility issues with Linux 3.0.y
Signed-off-by: faux123 <reioux@gmail.com>

Change-Id: Id2fb2aba7a8a94a0a31c090302eb877a4758327c
ARM: 7011/1: Add ARM cpu topology definition

The affinity between ARM processors is defined in the MPIDR register.
We can identify which processors are in the same cluster,
and which ones have performance interdependency. We can define the
cpu topology of ARM platform, that is then used by sched_mc and sched_smt.

The default state of sched_mc and sched_smt config is disable.
When enabled, the behavior of the scheduler can be modified with
sched_mc_power_savings and sched_smt_power_savings sysfs interfaces.

Changes since v4 :
*  Remove unnecessary parentheses and blank lines

Changes since v3 :
* Update the format of printk message
* Remove blank line

Changes since v2 :
* Update the commit message and some comments

Changes since v1 :
* Update the commit message
* Add read_cpuid_mpidr in arch/arm/include/asm/cputype.h
* Modify header of arch/arm/kernel/topology.c
* Modify tests and manipulation of MPIDR's bitfields
* Modify the place and dependancy of the config
* Modify Noop functions

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: 7182/1: ARM cpu topology: fix warning

kernel/sched.c:7354:2: warning: initialization from incompatible pointer type

Align cpu_coregroup_mask prototype interface with sched_domain_mask_f typedef
use int cpu instead of unsigned int cpu

Cc: <stable@vger.kernel.org>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: topology: save cpu id of each core
ARM: topology: Update topology according to current sched_mc mode
ARM: topology: Add a cpu_power function
ARM: topology: Add a topology update notification
ARM: cpu topology: Add asym topology flag for using cpu0 1st

Modify the CPU sched_domain flags in powersave mode for using the cpu0 in ched_mc powersave mode

Change-Id: I0652a9379d28af71e7cabb1f51956d71d28d3f2a
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
ARM: cpu topology: add debugfs
arm: Neon & hard-float support

Change-Id: I0577ca7e99ba2aa2a5ae79d0161a9246f0d0650d
Update to the new 2012 LZO algorithm

Change-Id: Ic58b659ba3ac676405e3ffe6a83bd4f0479d01e8
cpufreq: ondemand: Change the calculation of target frequency

The ondemand governor calculates load in terms of frequency and
increases it only if load_freq is greater than up_threshold
multiplied by the current or average frequency.  This appears to
produce oscillations of frequency between min and max because,
for example, a relatively small load can easily saturate minimum
frequency and lead the CPU to the max.  Then, it will decrease
back to the min due to small load_freq.

Change the calculation method of load and target frequency on the
basis of the following two observations:

 - Load computation should not depend on the current or average
   measured frequency.  For example, absolute load of 80% at 100MHz
   is not necessarily equivalent to 8% at 1000MHz in the next
   sampling interval.

 - It should be possible to increase the target frequency to any
   value present in the frequency table proportional to the absolute
   load, rather than to the max only, so that:

   Target frequency = C * load

   where we take C = policy->cpuinfo.max_freq / 100.

Tested on Intel i7-3770 CPU @ 3.40GHz and on Quad core 1500MHz Krait.
Phoronix benchmark of Linux Kernel Compilation 3.1 test shows an
increase ~1.5% in performance. cpufreq_stats (time_in_state) shows
that middle frequencies are used more, with this patch.  Highest
and lowest frequencies were used less by ~9%.

[rjw: We have run multiple other tests on kernels with this
 change applied and in the vast majority of cases it turns out
 that the resulting performance improvement also leads to reduced
 consumption of energy.  The change is additionally justified by
 the overall simplification of the code in question.]

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Grarak <williye97@gmail.com>

Conflicts:
	drivers/cpufreq/cpufreq_governor.c
	drivers/cpufreq/cpufreq_governor.h
	drivers/cpufreq/cpufreq_ondemand.c

Change-Id: I1789565e3f13d68abf42a0621ea45b6531abbadc
drivers: cpufreq: Send a uevent when governor changes

 * Useful so userspace tools can reconfigure.

Change-Id: Ib423910b8b9ac791ebe81a75bf399f58272f64f2
Signed-off-by: Dan Trifan <jimsth@gmail.com>
random: entropy tweaks are all the rage nowadays

use nonblocking for all.  Read this web page:
http://lwn.net/Articles/489734/

Change-Id: If2c2eb5257c06b31a4d8852aadfac3dda1659045
Signed-off-by: Dan Trifan <jimsth@gmail.com>
input: move add_input_randomness - patch from Google Code issue 42265
comment 162

Change-Id: I64852665827117a52b770737f02214e0fe3f7bd1
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Fix apparmor for PR_{GET,SET}_NO_NEW_PRIVS

Change-Id: I0d45c4ff76de855d6857304d5c6d71233c3b7e2d
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Dan Trifan <jimsth@gmail.com>