Backport msm 56624b45269ca913ec282694aa6ff9cf4a955aba
staging: android: lowmemorykiller: Don't count reserved free memory

The amount of reserved memory varies between devices. Subtract it
here to reduce the amount of devices specific tuning needed for the
minfree values.

Cc: Android Kernel Team <kernel-team@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
backport 99150f6a1a015de275a83ca95aa5f4054b409f40
android/lowmemorykiller: Only consider gfp_mask free pages

In certain memory configurations there can be a large number of
CMA pages which are not suitable to satisfy certain memory
requests.
This large number of unsuitable pages can cause the
lowmemorykiller to not kill any tasks because the
lowmemorykiller counts all free pages.

In order to ensure the lowmemorykiller properly evaluates the
free memory only count the free pages which are suitable for
satisfying the memory request.

Change-Id: Iabc3bebc54be9dec7fcbffb94a2fbf18dd684669
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
backport 25f87e504b356ffbac421533abf9e117ff65277c
backport 05d5ad4d0af90e05d63da7945282c7f5dc18f682
build fixes and a revert
attempt reduce io CPU load
remove tracing stuff from kernel
gitignore
disable useless wakelock emitters