Revert "lowmemorykiller.c : change module_param_named from S_IRUSR to S_IRUGO"

This reverts commit 6d426e30a67a718a1fcc8522a4867a1b2accd38e.
Revert "fix last commit"

This reverts commit fe531d5b41ea4d00627fcd91114e8c7b1a26cb45.
Revert "LMK update"

This reverts commit 81ff90c3858c1f610a96810eb88bc39eb498d97d.
Revert "staging: android: lowmemorykiller: Add config option to support oom_adj values (yank)"

This reverts commit e9398ebff0ca3d7681e748f6158c48ecbc68416b.
lowmemorykiller: updates from 3.4 kernel

Signed-off-by: Dan Trifan <jimsth@gmail.com>
staging: android: lowmemorykiller: Management of not killable processes

This feature allows the user to define processes and system processes
white-lists filled with the preferred process names and to not be killed
by lowmemorykiller, unless it is absolutely necessary.

This feature exposes four new lowmemorykiller parameters:
- donotkill_proc, is the flag to enable / disable this feature for the
  processes chosen by the user
- donotkill_sysproc, is the flag to enable / disable this feature for the
  system processes chosen by the user
- donotkill_proc_names, is the list of process names (comma separated)
  chosen by the user to be preserved from killing
- donotkill_sysproc_names, is the list of user system process names (comma separated)
  chosen by the user to be preserved from killing

When a the lowmemorykiller needs to free ram, it will first kill the processes
not included inside the two process name lists chosen by the user.
If there are no more standard killable processes, then it will be necessary to
kill one of the processes included inside one of the two white-lists, to
prevent system hangs, slowdowns, etc.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
android: lowmemorykiller: add lmk parameters tunning code.
There are cases that LMK doesn't run, even when it must run.
It is due to LMK shrinker not considering memory status per zone.
So add LMK parameters(other_free, other_file) tunnig code to
consider target zone of LMK shrinker.

Change-Id: I6f1f8660d5da920a0e3af45a160499965032081d
Git-commit: 22d990a58fc17b3f0155e15eb2dc3efa037bea1c
Git-repo: https://android.googlesource.com/kernel/common/
[ohaugan@codeaurora.org: Fix compilation issues]
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>

Signed-off-by: Dan Trifan <jimsth@gmail.com>
staging: android: lowmemorykiller: select a new task to kill
Under certain circumstances, a process may take time to handle a SIGKILL.
When lowmemkiller is called again shortly after, it would pick the same
process to kill over and over, so that we cann't get free memory for long time.

Solution is to check fatal_signal_pending() on the selected task, and if it's
already pending, select a new task to kill.

Cherry-pick 5e3358093351e5d48e21250e31896b855542f22c
Reviewed-on: http://gerrit.pcs.mot.com/479831

Change-Id: I53445114451ffaba293f3c7174fb0b01ed0d34b6
Signed-off-by: Tianshui Shi <kfp634@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/505410
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
(cherry picked from commit da093001caf06ed2296b4f79c84cc48ce713eac6)
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
lowmemorykiller: Account for highmem during kswapd reclaim
Currenlty most memory reclaim is done through kswapd.
Since kswapd uses a gfp mask of GFP_KERNEL, and because
the lowmemorykiller is zone aware, the lowmemorykiller will
ignore highmem most of the time.
This results in the lowmemorykiller being overly aggressive.

The fix to this issue is to allow the lowmemorykiller to
count highmem when being called by the kswapd if the lowmem
watermarks are satisfied.

Change-Id: I938644584f374763d10d429d835e74daa4854a38
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
fix emif.c
Revert "zram/zsmalloc issues in very low memory conditions."

This reverts commit b04a50c58f8153ebeec7a1be6225fa39e7c8f504.
Revert " Define vm.swappiness according to zram and frontswap (zswap) definition."

This reverts commit c2eb09530435210b6cb68fbfde18e4891ecb9776.
Revert "[PATCH 2/2] mm: forcely swapout when we are out of page cache"

This reverts commit b24f304f9a7a172146f66d2cc5639e82ade75bf3.

Conflicts:
	mm/vmscan.c
fix pm44xx.c
Revert "mm: add free_hot_cold_page_list() helper"

This reverts commit bf4f4cac66b1a42873d0850ddcaa4cab4a821764.
Revert "vmscan: add customisable shrinker batch size"

This reverts commit ca01c7c04312fee38357f21ed565f1db5ecf43c4.