More available RAM

Thanks to DerTeufel1980
Reduced Android Logger RAM usage. TNX to sakindia123@xda for point.
Bigmem
Enable UNALIGNED_ACCESS for the new LZO algorithm to use. LZO decrompression is used on QCACHE so we benefit a little from the new and improved LZO code.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
staging: android: lowmemorykiller: Reduce debug_level to 1

Under certain circumstances, such as after the lowmemorykiller
has recently killed an application, the logs can get flooded
with "select to kill" messages.

Change-Id: I7ae1de47c77d929e04b99be3432577d4f5fd1b2d
Signed-off-by: Liam Mark <lmark@codeaurora.org>
gpu: pvr: Update to DDK 1.8@2198402

 - Implemented a DC API change which queues a dummy display flip to
   workaround a rare and difficult to reproduce synchronization
   deadlock.
 - Eliminate log spam from Linux shrinker integration.

Conflicts:
	drivers/gpu/pvr/pvrversion.h

Change-Id: I11fdf76b3f8bc191a0c261a120eeaa19352d66e7
gpu: pvr: bypass compat check if version is same but build # is different
Add 1400MHz step

Change-Id: Ia610ab72cb37073357bc58189560691559d65410

Conflicts:

	arch/arm/mach-s5pv210/cpufreq.c
Replace 1.4GHz step with 1.32GHz

from mathkid
https://github.com/mathkid95/linux_samsung_jb/commit/d6faaa25a4982bfb93461fe264d70c906e43e8b8

Conflicts:

	arch/arm/mach-s5pv210/cpufreq.c
	arch/arm/mach-s5pv210/mach-aries.c
nf: xt_qtaguid: fix handling for cases where tunnels are used.

* fix skb->dev vs par->in/out
When there is some forwarding going on, it introduces extra state
around devs associated with xt_action_param->in/out and sk_buff->dev.
E.g.
   par->in and par->out are both set, or
   skb->dev and par->out are both set (and different)
This would lead qtaguid to make the wrong assumption about the
direction and update the wrong device stats.
Now we rely more on par->in/out.

* Fix handling when qtaguid is used as "owner"
When qtaguid is used as an owner module, and sk_socket->file is
not there (happens when tunnels are involved), it would
incorrectly do a tag stats update.

* Correct debug messages.

Bug: 11687690
Change-Id: I2b1ff8bd7131969ce9e25f8291d83a6280b3ba7f
Signed-off-by: JP Abgrall <jpa@google.com>
SELinux: include definition of new capabilities

The kernel has added CAP_WAKE_ALARM and CAP_EPOLLWAKEUP.  We need to
define these in SELinux so they can be mediated by policy.

Change-Id: I8a3e0db15ec5f4eb05d455a57e8446a8c2b484c2
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
[sds: rename epollwakeup to block_suspend to match upstream merge]
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Staging: zram: Remove useless offset calculation in handle_uncompressed_page()

The offset of uncompressed page is always zero: handle_uncompressed_page()
doesn't have to care about it.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: zram: Refactor zram_read/write() functions

This patch refactor the code of zram_read/write() functions. It does
not removes a lot of duplicate code alone, but is mostly a helper for
the third patch of this series (Staging: zram: allow partial page
operations).

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: zram: allow partial page operations

Commit 7b19b8d45b216ff3186f066b31937bdbde066f08 (zram: Prevent overflow
in logical block size) introduced ZRAM_LOGICAL_BLOCK_SIZE constant to
prevent overflow of logical block size on 64k page kernel.
However, the current implementation of zram only allow operation on block
of the same size as a page. That makes theorically legit 4k requests fail
on 64k page kernel.

This patch makes zram allow operation on partial pages. Basically, it
means we still do operations on full pages internally, but only copy the
relevent segments from/to the user memory.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: zram: Replace mutex lock by a R/W semaphore

Currently, nothing protects zram table from concurrent access.
For instance, ZRAM_UNCOMPRESSED bit can be cleared by zram_free_page()
called from a concurrent write between the time ZRAM_UNCOMPRESSED has
been set and the time it is tested to unmap KM_USER0 in
zram_bvec_write(). This ultimately leads to kernel panic.

Also, a read request can occurs when the page has been freed by a
running write request and before it has been updated, leading to
zero filled block being incorrectly read and "Read before write"
error message.

This patch replace the current mutex by a rw_semaphore. It extends
the protection to zram table (currently, only compression buffers are
protected) and read requests (currently, only write requests are
protected).

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: zram: Fix kunmapping order

This patch fixes the unmapping order of KM_USER0/1 in
handle_uncompressed_page() and zram_read() so that kmap()/kunmap() calls
are correctly nested.

Reported-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Reviewed-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: zram: make global var "devices" use unique name

The global variable "devices" is too general to be global.
This patch switches the name to be "zram_devices".

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: zram: make global var "num_devices" use unique name

The global variable "num_devices" is too general to be
global. This patch switches the name to be "zram_num_devices".

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: zram: fix zram locking

Currently init_lock only prevents concurrent execution of zram_init_device()
and zram_reset_device() but not zram_make_request() nor sysfs store functions.

This patch changes init_lock into a rw_semaphore. A write lock is taken by
init, reset and store functions, a read lock is taken by zram_make_request().
Also, avoids to release the lock before calling __zram_reset_device() for
cleaning after a failed init, thus preventing any concurrent task to see an
inconsistent state of zram.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: zram: prevent accessing an unallocated table when init fails early

When the allocation of zram->table fails, we set zram->disksize to zero
to prevent accessing the unallocated table entries during cleanup.
However, we currently don't take this precaution when the initialization
fails earlier.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>