nick kvfree() from apparmor

too many places open-code it

Conflicts:
	mm/util.c

Bug: 17871993
Change-Id: I007f4b663d7af564b2ce4009f5e13eeeeb82929a
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Git-commit: 39f1f78d53b9bcbca91967380c5f0f2305a5c55f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[jgebben@codeaurora.org: Remove redundant apparmor code not present upstream]
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
fs/seq_file: fallback to vmalloc allocation

There are a couple of seq_files which use the single_open() interface.
This interface requires that the whole output must fit into a single
buffer.

E.g.  for /proc/stat allocation failures have been observed because an
order-4 memory allocation failed due to memory fragmentation.  In such
situations reading /proc/stat is not possible anymore.

Therefore change the seq_file code to fallback to vmalloc allocations
which will usually result in a couple of order-0 allocations and hence
also work if memory is fragmented.

For reference a call trace where reading from /proc/stat failed:

  sadc: page allocation failure: order:4, mode:0x1040d0
  CPU: 1 PID: 192063 Comm: sadc Not tainted 3.10.0-123.el7.s390x #1
  [...]
  Call Trace:
    show_stack+0x6c/0xe8
    warn_alloc_failed+0xd6/0x138
    __alloc_pages_nodemask+0x9da/0xb68
    __get_free_pages+0x2e/0x58
    kmalloc_order_trace+0x44/0xc0
    stat_open+0x5a/0xd8
    proc_reg_open+0x8a/0x140
    do_dentry_open+0x1bc/0x2c8
    finish_open+0x46/0x60
    do_last+0x382/0x10d0
    path_openat+0xc8/0x4f8
    do_filp_open+0x46/0xa8
    do_sys_open+0x114/0x1f0
    sysc_tracego+0x14/0x1a

Conflicts:
	fs/seq_file.c

Bug: 17871993
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Tested-by: David Rientjes <rientjes@google.com>
Cc: Ian Kent <raven@themaw.net>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Thorsten Diehl <thorsten.diehl@de.ibm.com>
Cc: Andrea Righi <andrea@betterlinux.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Stefan Bader <stefan.bader@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-commit: 058504edd02667eef8fac9be27ab3ea74332e9b4
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Change-Id: Iad795a92fee1983c300568429a6283c48625bd9a
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
fs/seq_file: Use vmalloc by default for allocations > PAGE_SIZE

Some OOM implementations are pretty trigger happy when it comes to
releasing memory for kmalloc() allocations.  We might as well head
straight to vmalloc for allocations over PAGE_SIZE.

Bug: 17871993
Change-Id: Ic0dedbadc8bf551d34cc5d77c8073938d4adef80
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
mm, oom: make dump_tasks public

Allow other functions to dump the list of tasks.
Useful for when debugging memory leaks.

Bug: 17871993
Change-Id: I76c33a118a9765b4c2276e8c76de36399c78dbf6
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
lowmemorykiller: make default lowmemorykiller debug message useful

lowmemorykiller debug messages are inscrutable and mostly useful
for debugging the lowmemorykiller, not explaining why a process
was killed.  Make the messages more useful by prefixing them
with "lowmemorykiller: " and explaining in more readable terms
what was killed, who it was killed for, and why it was killed.

The messages now look like:
[   76.997631] lowmemorykiller: Killing 'droid.gallery3d' (2172), adj 1000,
[   76.997635]    to free 27436kB on behalf of 'kswapd0' (29) because
[   76.997638]    cache 122624kB is below limit 122880kB for oom_score_adj 1000
[   76.997641]    Free memory is -53356kB above reserved

A negative number for free memory above reserved means some of the
reserved memory has been used and is being regenerated by kswapd,
which is likely what called the shrinkers.

Bug: 17871993
Change-Id: I1fe983381e73e124b90aa5d91cb66e55eaca390f
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
lowmemorykiller: enhance debug information

Add extra debug information to make it easier to both determine
why the lowmemorykiller killed a process and to help find the source
of memory leaks.

Also increase the debug level for "select" statements to help prevent
flooding the log.

Bug: 17871993
Change-Id: I3b6876c5ecdf192ecc271aed3f37579f66d47a08
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:
	drivers/staging/android/lowmemorykiller.c
kgsl: do not vmap/memset to zero-out pages

b/18402205 External reports: Video playback failing on Flo after upgrade to
	   Lollipop

Change-Id: I358328ba2bd543d77e4218f32b0695c2f6f6e6c9
Signed-off-by: Iliyan Malchev <malchev@google.com>
Effectively revert "gpu: ion: replace __GFP_ZERO with manual zero'ing"

	commit d21375bd0e3b5c9fb1bfd341abb294349ca2507f
	Author: Mitchel Humpherys <mitchelh@codeaurora.org>
	Date:   Thu Jan 31 10:30:40 2013 -0800

	    gpu: ion: replace __GFP_ZERO with manual zero'ing

	    As a performance optimization, omit the __GFP_ZERO flag when
	    allocating individual pages and, instead, zero out all of the pages in
	    one fell swoop.

	    CRs-Fixed: 449035
	    Change-Id: Ieb9a895d8792727a8a40b1e27cb1bbeae098f581
	    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

b/18402205 External reports: Video playback failing on Flo after upgrade to
	   Lollipop

Change-Id: Ibd07d3ac0edd11278306d4dbe72050408cc8e09b
Signed-off-by: Iliyan Malchev <malchev@google.com>
Merge branch 'android-msm-flo-3.4-lollipop-release' into ElementalX-3.00
Revert "DRIVERS: SLIMBUS: some more tweaks: Set ROOT_FREQ at 22, which is double what we had before. According to some documents this is what we want for optimium audio quality Forcec SLIM_RATE to 44.1KHz and 48KHz instead of much lower values. This way it will be forced to run at these freqs to match the majority of audio files user will be playing."

This reverts commit 59604bb5cb2195c008717e0746ce2596df9216e9.
Revert "DRIVERS: SLIMBUS: slimbus enhancements mkII"

This reverts commit f188ca14bdc27cdcdd02baeccee01655dc06a90e.
Revert "DRIVERS: SLIMBUS: initial overclocking of slimbus .Increase root freq from 11 (24.526MHz) to 31 max (27+MHz) which is the largest it will take .Increase clock gear from 7 to 10 (max again)"

This reverts commit 4884d513366ea8744fe4b90b360ea1ca25fe3760.
msm: kgsl: Allow GPU start to run in a high priority queue

The GPU start sequence needs to run with low latency when coming
out of slumber for the first draw command. For those cases allow the
start function to be queued into a high priority workqueue to reduce
the chance of it getting scheduled out.

Change-Id: Ic0dedbada7ef4d63b54e826862fbefdfb71a092a
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: flar2 <asegaert@gmail.com>
msm: kgsl: Add an input handler to power up the GPU on a touch event

On a device where the primary input is a touchscreen nobody is
surprised that touch events are often the catalyst for drawing
frames. If the GPU is in slumber we can get a jump on the action
by watching for touch events and turning the GPU on in anticipation
of a draw call. Register for events from all input drivers
returning EV_ABS events and queue a work task to power up the GPU
if it is currently in slumber.

Change-Id: Ic0dedbadbdc96ef9ddd78252ea65f8e1cdd00110
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
msm: kgsl: Fix nice level for higher priority GPU start thread

Before, we were actually setting the lowest possible priority.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
msm: kgsl: Schedule adreno_start in a high priority workqueue

Better safe than sorry. Also, return early if we didn't set a _wake_timeout.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
update defconfig
lcd-kcal: do not update lut preset
wake gestures: disable by default