Merge branch 'jb-4.2.2'
Merge branch 'Origin'

Conflicts:
	sbuild.sh
Merge branch 'jb-4.2.2'

Signed-off-by: Nick0703 <lokesh.c703@gmail.com>
Add new scheduler: BFQ-v5r1 for 3.0

Change-Id: I40f4458284d4d086b47ee73c4d79c8b13458955f
Signed-off-by: Nick0703 <lokesh.c703@gmail.com>

Conflicts:

	arch/arm/configs/aries_galaxysmtd_defconfig
	block/Makefile (reverse-merged from commit cdcdb3ac245e99005c0a3c706ae513f9b3c2d70b)
Massive update to IO schedulers

Patches from DerTeufel smdk4412 kernel

Original work of many authors, Individual patches:

block: fiops bias sync workload
block: fiops preserve vios key for deep queue depth workload
block: fiops add ioprio support
block: fiops sync/async scale
block: fiops read/write request scale
block: fiops ioscheduler core
by: Shaohua Li

block: row: Fix starvation tolerance values
by: Maya Erez authored 2 months ago

block: urgent request: Update dispatch_urgent in case of requeue/rein
block: row: Update sysfs functions
block: row: Prevent starvation of regular priority by high priority
block: urgent request: remove unnecessary urgent marking
block: row: Re-design urgent request notification mechanism
block: row: Update initial values of ROW data structures
block: row: Don't notify URGENT if there are un-completed urgent req
block: row: Idling mechanism re-factoring
block: row: Dispatch requests according to their io-priority
block:row: fix idling mechanism in ROW
block: ROW: Correct minimum values of ROW tunable parameters
by: Tatyana Brokhman

block: blk-core: add printk_ratelimit
by: Asutosh Das

block: blk-merge: don't merge the pages with non-contiguous descriptors
by: Subhash Jadavani authored 5 months ago

cfq-iosched: Fix null pointer dereference
by: Sujit Reddy Thumma

block: Add BLKROTATIONAL ioctl
block: Introduce blk_set_stacking_limits function
by: Martin K. Petersen

block: remove WARN_ON_ONCE() in exit_io_context()
block: an exiting task should be allowed to create io_context
block: recursive merge requests
by: Tejun Heo

block: ioc_cgroup_changed() needs to be exported
by: axboe

block, cfq: fix empty queue crash caused by request merge
by: Shaohua Li

block, cfq: move icq creation and rq->elv.icq association to block core
block, cfq: restructure io_cq creation path for io_context interface
block, cfq: move io_cq exit/release to blk-ioc.c
block, cfq: move icq cache management to block core
block, cfq: move io_cq lookup to blk-ioc.c
block, cfq: move cfqd->icq_list to request_queue and add request->elv
block, cfq: reorganize cfq_io_context into generic and cfq specific
block, cfq: replace current_io_context() with create_io_context() …
block, cfq: kill cic->key
block, cfq: kill ioc_gone
block, cfq: remove delayed unlink
block, cfq: unlink cfq_io_context's immediately
block, cfq: fix cic lookup locking
block, cfq: fix race condition in cic creation path and tighten locking
block, cfq: move ioc ioprio/cgroup changed handling to cic
block, cfq: misc updates to cfq_io_context
block, cfq: move cfqd->cic_index to q->id
block: misc updates to blk_get_queue()
Initialize request_count in __make_request
block: make ioc get/put interface more conventional and fix race
block: misc ioc cleanups
block: add missing blk_queue_dead() checks
block: fix drain_all condition in blk_drain_queue()
block: add blk_queue_dead()
block, sx8: kill blk_insert_request()
block: don't call blk_drain_queue() if elevator is not up
block: fix request_queue lifetime handling by making blk_queue_cleanup
block: drop @tsk from attempt_plug_merge() and explain sync rules
block: make get_request[_wait]() fail if queue is dead
block: reorganize throtl_get_tg() and blk_throtl_bio()
block: drop unnecessary blk_get/put_queue() in scsi_cmd_ioctl()
block: reorganize queue draining
block: pass around REQ_* flags instead of broken down booleans during
block: move blk_throtl prototypes to block/blk.h
block: fix genhd refcounting in blkio_policy_parse_and_set()
by: Tejun Heo

blk-throttle: use queue_is_locked() instead of lockdep_is_held()
by: axboe

blk-throttle: Take blkcg->lock while traversing blkcg->policy_list
blk-throttle: Free up policy node associated with deleted rule
by: Vivek Goyal

block: warn if tag is greater than real_max_depth
block: Remove the control of complete cpu from bio
by: taoma-tm

blk-flush: fix invalid BUG_ON in blk_insert_flush
by: Jeff Moyer

block: fix a typo in the blk-cgroup.h file
by: pibroch

ida: make ida_simple_get/put() IRQ saf
by: Tejun Heo

fixlet: Remove fs_excl from struct task.
by: Justin TerAvest

block: strict rq_affinity
by: djbw

block: reorder request_queue to remove 64 bit alignment padding
by: Richard Kennedy

block: document blk_plug list access
block: avoid building too big plug list
by: Shaohua Li

block:fix the comment error in blkdev.h
by: gaowanlong

backing-dev: use synchronize_rcu_expedited instead of synchronize_rcu
by: Mikulas Patocka

compat_ioctl: fix warning caused by qemu
compat_ioctl: fix make headers_check regression
by: Johannes Stezenbach

Conflicts:
	block/Kconfig.iosched
	block/Makefile
	block/deadline-iosched.c
	include/linux/elevator.h
fs/dyn_sync_cntrl: dynamic sync control

The dynamic sync control interface uses Android kernel's unique early
suspend / lat resume interface.

While screen is on, file sync is disabled
when screen is off, a file sync is called to flush all outstanding writes
and restore file sync operation as normal.

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	fs/Makefile
	fs/sync.c
fs/dyn_sync_cntrl: check dyn fsync control's active prior to performing fsync ops

Signed-off-by: Andrew Bartholomew <andrewb03@gmail.com>
fs/dyn_sync_cntrl: add some cache optimizations

and clean up file format and typos

bump version to 1.1

Signed-off-by: Paul Reioux <reioux@gmail.com>
fs/dyn_sync_cntrl: favor true case since most will be using this feature

Signed-off-by: Paul Reioux <reioux@gmail.com>
fs/dyn_sync_cntrl: add reboot notifier to force flush outstanding data

this should further prevent data corruption from kernel panics and
forced reboots

bump version to 1.2

Signed-off-by: Paul Reioux <reioux@gmail.com>
fs/dyn_sync_cntrl: add kernel panic notifier to force flush outstanding data

more paranoia safety checks

Signed-off-by: Paul Reioux <reioux@gmail.com>
Enabled Dynamic FSync and set higher readahead

Conflicts:
	arch/arm/configs/GearKernelJB_galaxys_defconfig
	include/linux/mm.h
ARM: compressed/head.S: work around new binutils warning

In August 2012, Matthew Gretton-Dann checked a change
into binutils labelled "Error on obsolete & warn on
deprecated registers", apparently as part of ARMv8
support. Apparently, this was supposed to emit
the message "Warning: This coprocessor register access
is deprecated in ARMv8" when using certain mcr/mrc
instructions and building for ARMv8. Unfortunately,
the message that is actually emitted appears to be
'(null)', which is less helpful in comparison.

Even more unfortunately, this is biting us on
every single kernel build with a new gas, because
arch/arm/boot/compressed/head.S and some other files
in that directory are built with -march=all since
kernel commit 80cec14a8 "[ARM] Add -march=all to
assembly file build in arch/arm/boot/compressed"
back in v2.6.28.

This patch reverts Russell's nice solution and
replaces it with a more complex one that sprinkles
.arch statements inside of the head.S file in
functions that are executed in different architecture
levels, which seems to solve the original problem
just as well, and gets rid of the new one, too.

Without this patch, building anything results in:

arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:565: Warning: (null)
arch/arm/boot/compressed/head.S:676: Warning: (null)
arch/arm/boot/compressed/head.S:698: Warning: (null)
arch/arm/boot/compressed/head.S:722: Warning: (null)
arch/arm/boot/compressed/head.S:726: Warning: (null)
arch/arm/boot/compressed/head.S:957: Warning: (null)
arch/arm/boot/compressed/head.S:996: Warning: (null)
arch/arm/boot/compressed/head.S:997: Warning: (null)
arch/arm/boot/compressed/head.S:1027: Warning: (null)
arch/arm/boot/compressed/head.S:1035: Warning: (null)
arch/arm/boot/compressed/head.S:1046: Warning: (null)
arch/arm/boot/compressed/head.S:1060: Warning: (null)
arch/arm/boot/compressed/head.S:1092: Warning: (null)
arch/arm/boot/compressed/head.S:1094: Warning: (null)
arch/arm/boot/compressed/head.S:1095: Warning: (null)
arch/arm/boot/compressed/head.S:1102: Warning: (null)
arch/arm/boot/compressed/head.S:1134: Warning: (null)

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Paul Beeler <sparksco@gmail.com>
Performance regression from switching lock to rw-sem for anon-vma tree

On 06/14/2013 07:43 AM, Davidlohr Bueso wrote:
> I was hoping that the lack of spin on owner was the main difference with
> rwsems and am/was in the middle of implementing it. Could you send your
> patch so I can give it a try on my workloads?
>
> Note that there have been a few recent (3.10) changes to mutexes that
> give a nice performance boost, specially on large systems, most
> noticeably:
>
> commit 2bd2c92c (mutex: Make more scalable by doing less atomic
> operations)
>
> commit 0dc8c730 (mutex: Queue mutex spinners with MCS lock to reduce
> cacheline contention)
>
> It might be worth looking into doing something similar to commit
> 0dc8c730, in addition to the optimistic spinning.

It is a good tunning for large machine. I just following what the commit
0dc8c730 done, give a RFC patch here. I tried it on my NHM EP machine. seems no
clear help on aim7. but maybe it is helpful on large machine.  :)

Signef-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	lib/rwsem.c
Remove -Werror flags.

Signed-off-by: Nick0703 <lokesh.c703@gmail.com>
Linux 3.0.85
block: V(R) I/O Scheduler

Conflicts:
	block/Kconfig.iosched
	block/Makefile
mutex: dynamically disable mutex spinning at high load
Date	Thu, 4 Apr 2013 10:54:18 -0400

The Linux mutex code has a MUTEX_SPIN_ON_OWNER configuration
option that was enabled by default in major distributions like Red
Hat. Allowing threads waiting on mutex to spin while the mutex owner
is running will theoretically reduce latency on the acquisition of
mutex at the expense of energy efficiency as the spinning threads
are doing no useful work.

This is not a problem on a lightly loaded system where the CPU may
be idle anyway. On a highly loaded system, the spinning tasks may be
blocking other tasks from running even if they have higher priority
because the spinning was done with preemption disabled.

This patch will disable mutex spinning if the current load is high
enough. The load is considered high if there are 2 or more active tasks
waiting to run on the current CPU. If there is only one task waiting,
it will check the average load at the past minute (calc_load_tasks).
If it is more than double the number of active CPUs, the load is
considered high too.  This is a rather simple metric that does not
incur that much additional overhead.

The AIM7 benchmarks were run on 3.7.10 derived kernels to show the
performance changes with this patch on a 8-socket 80-core system
with hyperthreading off.  The table below shows the mean % change
in performance over a range of users for some AIM7 workloads with
just the less atomic operation patch (patch 1) vs the less atomic
operation patch plus this one (patches 1+3).

+--------------+-----------------+-----------------+-----------------+
|   Workload   | mean % change   | mean % change   | mean % change   |
|              | 10-100 users    | 200-1000 users  | 1100-2000 users |
+--------------+-----------------+-----------------+-----------------+
| alltests     |      0.0%       |     -0.1%       |    +5.0%        |
| five_sec     |     +1.5%       |     +1.3%       |    +1.3%        |
| fserver      |     +1.5%       |    +25.4%       |    +9.6%        |
| high_systime |     +0.1%       |      0.0%       |    +0.8%        |
| new_fserver  |     +0.2%       |    +11.9%       |   +14.1%        |
| shared       |     -1.2%       |     +0.3%       |    +1.8%        |
| short        |     +6.4%       |     +2.5%       |    +3.0%        |
+--------------+-----------------+-----------------+-----------------+
It can be seen that this patch provides some big performance
improvement for the fserver and new_fserver workloads while is still
generally positive for the other AIM7 workloads.

Signed-off-by: Waiman Long <Waiman.Long@hp.com>
Reviewed-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
modified for tuna kernel from LKML

Signed-off-by: Paul Reioux <reioux@gmail.com>
Fix VR scheduler compile error.

Signed-off-by: Nick0703 <lokesh.c703@gmail.com>
Added 3 CPU governors:
- InteractiveX
- Lioneheart
- OnDemandX

Signed-off-by: Nick0703 <lokesh.c703@gmail.com>