fs/block-dev.c:fix performance regression in O_DIRECT writes to md block devices

For regular file, write operaion used blk_plug function.But for block
file,write operation did not use blk_plug.
This patch is also for write-cache mode for block-device.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
ARM: Allow arm_memblock_steal() to remove memory from any RAM region

Allow arm_memblock_steal() to remove memory from any RAM region,
including highmem areas.  This allows memory to be stolen from the
very top of declared memory, including highmem areas, rather than
our precious lowmem.

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
block: move down direct IO plugging

Move unplugging for direct I/O from around ->direct_IO() down to
do_blockdev_direct_IO(). This implicitly adds plugging for direct
writes.

CC: Li Shaohua <shli@fusionio.com>
Acked-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
direct-io: don't read inode->i_blkbits multiple times

Since directio can work on a raw block device, and the block size of the
device can change under it, we need to do the same thing that
fs/buffer.c now does: read the block size a single time, using
ACCESS_ONCE().

Reading it multiple times can get different results, which will then
confuse the code because it actually encodes the i_blksize in
relationship to the underlying logical blocksize.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Support asynchronous compaction in lowmemorykiller. (adapted from Steve Kondik's commit from N7 kernel)
android: lowmemorykiller: modify return values to avoid extra calls

If the shrinker returns a large cache size, it will get called
repeatedly, proportional to the cache size divided by 128.  If
no processes to kill were found on the last pass through the
shrinker, there is no reason calling it again immediately will
find a process to kill.

Avoid the extra calls to the shrinker by:
Returning 0 when the shrinker is called with 0 and there are plenty
of free or file pages.  Avoids calling the shrinker at all during
this pass.
Returning rem when a thread is already dying.  Avoids telling the
shrinker core that the lowmemorykiller is making immense amounts
of forward progress.
Returning -1 when no process was selected for death.  Avoids calling
the shrinker again when nothing has changed.

Change-Id: I08f06063084f6070e71ac6afa7b14377149f3685
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Staging: android: binder: Add binder buffers to kmemleak

Some binder_transaction structs are only referenced by a
binder_buffer. This could cause kmemleak to report them as
unreferenced.

Change-Id: I939540faa547afac4284f70f0e08ceb57a7a823d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: acpuclock-krait: NULL terminate L2 table for find_cur_l2_level()

find_cur_l2_level() assumes that the L2 table is NULL terminated
when it has never been terminated. Therefore, if the rate that is
read from the hardware during boot is not found in the table we
will run off the end of the table and read potential junk values.
NULL terminate all the L2 tables so that the loop in
find_cur_l2_level() is guaranteed to terminate.

Change-Id: Ia5d0213000b44def35e388fd3cadf0293344257b
Reported-by: Laura Abbot <lauraa@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: acpuclock-krait: Keep the secondary MUX input fixed

With use of the QSB clock source recently eliminated, only one
input of the secondary clock MUX is used on any target. Since
there is overhead involved reprogramming this MUX when changing
the CPU and L2 frequencies, change the code to just program the
MUX at boot.  Most noticeably, this removes a 1us delay from
every CPU and L2 frequency switch.

Change-Id: I5cd8c981f1be49be7dbba1310d84df439e8be83b
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: acpuclock-8064: Add support for 8064v1.1 FASTER PVS bin

Add updated PVS data.

Change-Id: I011241d3ea3943673a888cd0aeca925440500ff2
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Enable HAVE_EFFICIENT_UNALIGNED_ACCESS in all Krait cores.
Increase readahead value to 512kb.
sched: LOAD_FREQ (4*HZ+61) avoids loadavg Moire. From http://ripke.com/loadavg/moire.
staging: prima: less debugging

Change-Id: Id603648b49d56d623ecec69bd00bc7772660cb54
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>