massive revert of previous updates to block/scsi/dm
Backported ROW I/O Scheduler from linux 3.5 (1/2)

Not working yet...But all the dependencies are here.

Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	block/Kconfig.iosched
	include/linux/blkdev.h
	include/linux/kernel.h
	lib/Makefile
	lib/kstrtox.c
Updated ROW IO Scheduler and backported it (2/2)

Initial tests doesn't show any data corruption

Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	include/linux/blkdev.h
Update to BFQ v4
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Update defconfig flags for improved wireless/net performance. (hopefully)
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
ARM: 6867/1: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
ARM: 6868/1: Preserve the VFP state during fork
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
ARM: Use struct syscore_ops instead of sysdevs for PM in common code

Convert some ARM architecture's common code to using
struct syscore_ops objects for power management instead of sysdev
classes and sysdevs.

This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	arch/arm/kernel/leds.c
ARM: vfp: Move exception address fixup into vfphw.S

If the PC on the stack is updated in entry-armv.S,
do_undefinstr can get called after the fixup.  do_undefinstr
does its own fixup, and doing both causes the PC to point to
half way through an instruction.

Instead, do the fixup in do_vfp, where only the vfp code
can get called.

Change-Id: I6d966887adc8ed58d88bfe0cb3c0ba29213be488
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	arch/arm/kernel/entry-armv.S
ARM: vfp: Always save VFP state in vfp_pm_suspend

vfp_pm_suspend should save the VFP state in suspend after
any lazy context switch.  If it only saves when the VFP is enabled,
the state can get lost when, on a UP system:
  Thread 1 uses the VFP
  Context switch occurs to thread 2, VFP is disabled but the
     VFP context is not saved
  Thread 2 initiates suspend
  vfp_pm_suspend is called with the VFP disabled, and the unsaved
     VFP context of Thread 1 in the registers

Modify vfp_pm_suspend to save the VFP context whenever
vfp_current_hw_state is not NULL.

Change-Id: I91f29722d256a3afc1cc04df8b227541434ccffb
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Barry Song <bs14@csr.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Colin Cross <ccross@android.com>
ARM: VFP: fix emulation of second VFP instruction

commit 5e4ba617c1b584b2e376f31a63bd4e734109318a upstream.

Martin Storsjö reports that the sequence:

        ee312ac1        vsub.f32        s4, s3, s2
        ee702ac0        vsub.f32        s5, s1, s0
        e59f0028        ldr             r0, [pc, #40]
        ee111a90        vmov            r1, s3

on Raspberry Pi (implementor 41 architecture 1 part 20 variant b rev 5)
where s3 is a denormal and s2 is zero results in incorrect behaviour -
the instruction "vsub.f32 s5, s1, s0" is not executed:

        VFP: bounce: trigger ee111a90 fpexc d0000780
        VFP: emulate: INST=0xee312ac1 SCR=0x00000000
        ...

As we can see, the instruction triggering the exception is the "vmov"
instruction, and we emulate the "vsub.f32 s4, s3, s2" but fail to
properly take account of the FPEXC_FP2V flag in FPEXC.  This is because
the test for the second instruction register being valid is bogus, and
will always skip emulation of the second instruction.

Reported-by: Martin Storsjö <martin@martin.st>
Tested-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sdio: optimized SDIO IRQ handling for single irq
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Fix up vfp commit from earlier
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
Mock tuna defconfig flags for net/netfilter.
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>
ARM: 6380/1: Introduce __sync_icache_dcache() for VIPT caches

    On SMP systems, there is a small chance of a PTE becoming visible to a
    different CPU before the current cache maintenance operations in
    update_mmu_cache(). To avoid this, cache maintenance must be handled in
    set_pte_at() (similar to IA-64 and PowerPC).

    This patch provides a unified VIPT cache handling mechanism and
    implements the __sync_icache_dcache() function for ARMv6 onwards
    architectures. It is called from set_pte_at() and replaces the
    update_mmu_cache(). The latter is still used on VIVT hardware where a
    vm_area_struct is required.

    Tested-by: Rabin Vincent <rabin.vincent@stericsson.com>
    Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	arch/arm/mm/fault-armv.c
Revert "LMK from 3.8"

This reverts commit 060dec38499301b57e9fa371fae1cc8414db2a7e.
Revert "OOM rework and fixes for 2.6.35.7 (existz)"

This reverts commit 8e74f080141f744b4a538bec34b2a56cbc748c00.
Updates
- Add and enable frontswap (@lupohirp)
- Backport Memory Manager (mm) from Code Aurora Forum kernel, ics_chocolate branch (@androidmeda)

Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	.config
	arch/arm/mach-msm/lge/board-thunderg.c
	fs/ext3/super.c
	fs/ext4/super.c
	fs/proc/base.c
	include/linux/cleancache.h
	include/linux/fs.h
	include/linux/mm.h
	include/linux/percpu_counter.h
	mm/Kconfig
	mm/cleancache.c

Conflicts:
	fs/proc/base.c
oom: badness heuristic rewrite

This a complete rewrite of the oom killer's badness() heuristic which is
used to determine which task to kill in oom conditions.  The goal is to
make it as simple and predictable as possible so the results are better
understood and we end up killing the task which will lead to the most
memory freeing while still respecting the fine-tuning from userspace.

Instead of basing the heuristic on mm->total_vm for each task, the task's
rss and swap space is used instead.  This is a better indication of the
amount of memory that will be freeable if the oom killed task is chosen
and subsequently exits.  This helps specifically in cases where KDE or
GNOME is chosen for oom kill on desktop systems instead of a memory
hogging task.

The baseline for the heuristic is a proportion of memory that each task is
currently using in memory plus swap compared to the amount of "allowable"
memory.  "Allowable," in this sense, means the system-wide resources for
unconstrained oom conditions, the set of mempolicy nodes, the mems
attached to current's cpuset, or a memory controller's limit.  The
proportion is given on a scale of 0 (never kill) to 1000 (always kill),
roughly meaning that if a task has a badness() score of 500 that the task
consumes approximately 50% of allowable memory resident in RAM or in swap
space.

The proportion is always relative to the amount of "allowable" memory and
not the total amount of RAM systemwide so that mempolicies and cpusets may
operate in isolation; they shall not need to know the true size of the
machine on which they are running if they are bound to a specific set of
nodes or mems, respectively.

Root tasks are given 3% extra memory just like __vm_enough_memory()
provides in LSMs.  In the event of two tasks consuming similar amounts of
memory, it is generally better to save root's task.

Because of the change in the badness() heuristic's baseline, it is also
necessary to introduce a new user interface to tune it.  It's not possible
to redefine the meaning of /proc/pid/oom_adj with a new scale since the
ABI cannot be changed for backward compatability.  Instead, a new tunable,
/proc/pid/oom_score_adj, is added that ranges from -1000 to +1000.  It may
be used to polarize the heuristic such that certain tasks are never
considered for oom kill while others may always be considered.  The value
is added directly into the badness() score so a value of -500, for
example, means to discount 50% of its memory consumption in comparison to
other tasks either on the system, bound to the mempolicy, in the cpuset,
or sharing the same memory controller.

/proc/pid/oom_adj is changed so that its meaning is rescaled into the
units used by /proc/pid/oom_score_adj, and vice versa.  Changing one of
these per-task tunables will rescale the value of the other to an
equivalent meaning.  Although /proc/pid/oom_adj was originally defined as
a bitshift on the badness score, it now shares the same linear growth as
/proc/pid/oom_score_adj but with different granularity.  This is required
so the ABI is not broken with userspace applications and allows oom_adj to
be deprecated for future removal.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>

Conflicts:
	fs/proc/base.c
LMK from 3.8
Signed-off-by: scotthartbti <scott.hart.bti@gmail.com>