History log of /drivers/staging/android/lowmemorykiller.c
Revision Date Author Comments
fbc83982bfd53d66bde7e3360edb4f8c5900de70 26-May-2015 Martijn Coenen <maco@google.com> lowmemorykiller: trace kill events.

Allows for capturing lmk kill events and
their rationale.

Change-Id: Ibe215db5bb9806fc550c72c0b9832c85cbd56bf6
Signed-off-by: Martijn Coenen <maco@google.com>
63351df85f7ece011618955054c1b0d15b393691 26-Jan-2015 Ruchi Kandoi <kandoiruchi@google.com> Fix compile errors in accordance with changes from 3.14 to 3.18

Signed-off-by: Ruchi Kandoi<kandoiruchi@google.com>
bad385c687f886ef7371628cb239aca6e408708c 03-May-2013 Colin Cross <ccross@android.com> 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.

Change-Id: I1fe983381e73e124b90aa5d91cb66e55eaca390f
Signed-off-by: Colin Cross <ccross@android.com>
c034ef70c63ff50b8c963c275909d2c4dd1a962e 26-Sep-2012 Arve Hjønnevåg <arve@android.com> staging: android: lowmemorykiller: Add config option to support oom_adj values

The conversion to use oom_score_adj instead of the deprecated oom_adj
values breaks existing user-space code. Add a config option to convert
oom_adj values written to oom_score_adj values if they appear to be
valid oom_adj values.

Change-Id: I68308125059b802ee2991feefb07e9703bc48549
Signed-off-by: Arve Hjønnevåg <arve@android.com>
ae57804a6aae5fbbc5faf8cd572dcc1fff494607 07-May-2010 San Mehat <san@google.com> staging: android: lowmemorykiller: Fix task_struct leak

As it turns out, the CONFIG_PROFILING interfaces leak a
task struct if the notifier chain returns NOTIFY_OK.. doh.

This patch reworks lowmemkiller to use the new generic task
free notifier chain.

Signed-off-by: San Mehat <san@google.com>
058dbde928597e7a8bd04e28e77e5cfc4270591d 26-Feb-2014 Vinayak Menon <vinayakm.list@gmail.com> staging: android: lowmemorykiller: neglect swap cached pages in other_file

With ZRAM enabled it is observed that lowmemory killer
doesn't trigger properly. swap cached pages are
accounted in NR_FILE, and lowmemorykiller considers
this as reclaimable and adds to other_file. But these
pages can't be reclaimed unless lowmemorykiller triggers.
So subtract swap pages from other_file.

Signed-off-by: Vinayak Menon <vinayakm.list@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6bc2b856bb7c49f238914d965c0b1057ec78226e 14-Feb-2014 Weijie Yang <weijie.yang@samsung.com> staging: android: lowmemorykiller: set TIF_MEMDIE before send kill sig

Set TIF_MEMDIE tsk_thread flag before send kill signal to the
selected thread. This is to fit a usual code sequence and avoid
potential race issue.

Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7dc19d5affd71370754a2c3d36b485810eaee7a1 28-Aug-2013 Dave Chinner <dchinner@redhat.com> drivers: convert shrinkers to new count/scan API

Convert the driver shrinkers to the new API. Most changes are compile
tested only because I either don't have the hardware or it's staging
stuff.

FWIW, the md and android code is pretty good, but the rest of it makes me
want to claw my eyes out. The amount of broken code I just encountered is
mind boggling. I've added comments explaining what is broken, but I fear
that some of the code would be best dealt with by being dragged behind the
bike shed, burying in mud up to it's neck and then run over repeatedly
with a blunt lawn mower.

Special mention goes to the zcache/zcache2 drivers. They can't co-exist
in the build at the same time, they are under different menu options in
menuconfig, they only show up when you've got the right set of mm
subsystem options configured and so even compile testing is an exercise in
pulling teeth. And that doesn't even take into account the horrible,
broken code...

[glommer@openvz.org: fixes for i915, android lowmem, zcache, bcache]
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Glauber Costa <glommer@openvz.org>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Kent Overstreet <koverstreet@google.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Carlos Maiolino <cmaiolino@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Rientjes <rientjes@google.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: J. Bruce Fields <bfields@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Kent Overstreet <koverstreet@google.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
6b83f9150ff5d23355fc3baf6960801fb1525f77 16-Mar-2013 Dmitry Voytik <dvv.kernel@gmail.com> staging: android: lowmemorykiller: well-marked debug print

Add "lowmemorykiller:" prefix to the debug print so it's easier to
analyse LMK's debug output:
dmesg | grep lowmemorykiller

Signed-off-by: Dmitry Voytik <dvv.kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
99150f6a1a015de275a83ca95aa5f4054b409f40 27-Feb-2013 Arve Hjønnevåg <arve@android.com> staging: android: lowmemorykiller: Change default debug_level to 1

The select...to kill messages are not very useful when not debugging
the lowmemorykiller itself. After the change to check TIF_MEMDIE
instead of using a task notifer this message can also get very
noisy.

Cc: Android Kernel Team <kernel-team@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
eeb0f4f35fc1a4c0a5e30ec73e8e61916afa0399 27-Feb-2013 Arve Hjønnevåg <arve@android.com> 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>
a9c58b907dbc6821533dfc295b63caf111ff1f16 12-Dec-2012 David Rientjes <rientjes@google.com> mm, oom: change type of oom_score_adj to short

The maximum oom_score_adj is 1000 and the minimum oom_score_adj is -1000,
so this range can be represented by the signed short type with no
functional change. The extra space this frees up in struct signal_struct
will be used for per-thread oom kill flags in the next patch.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
83dbbdbb38666e20a75fad2294cf1df77c52f121 10-Apr-2012 David Rientjes <rientjes@google.com> android, lowmemorykiller: remove task handoff notifier

The task handoff notifier leaks task_struct since it never gets freed
after the callback returns NOTIFY_OK, which means it is responsible for
doing so.

It turns out the lowmemorykiller actually doesn't need this notifier at
all. It's used to prevent unnecessary killing by waiting for a thread
to exit as a result of lowmem_shrink(), however, it's possible to do
this in the same way the kernel oom killer works by setting TIF_MEMDIE
and avoid killing if we're still waiting for it to exit.

The kernel oom killer will already automatically set TIF_MEMDIE for
threads that are attempting to allocate memory that have a fatal signal.
The thread selected by lowmem_shrink() will have such a signal after the
lowmemorykiller sends it a SIGKILL, so this won't result in an
unnecessary use of memory reserves for the thread to exit.

This has the added benefit that we don't have to rely on
CONFIG_PROFILING to prevent needlessly killing tasks.

Reported-by: Werner Landgraf <w.landgraf@ru.ru>
Cc: stable@vger.kernel.org
Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
624b225035b24e9d7c22cc214f449fc2ec2491c9 07-Mar-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org> Staging: android: lowmemorykiller.c

Fix compiler warning about the type of the module parameter.

Cc: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1eda5166c7640092f512138be6899d050c3d62ed 07-Mar-2012 Paul E. McKenney <paulmck@linux.vnet.ibm.com> staging: android/lowmemorykiller: Don't unregister notifier from atomic context

The lowmemorykiller registers an atomic notifier for notfication of when
the task is freed. From this atomic notifier callback, it removes the
atomic notifier via task_free_unregister(). This is incorrect because
atomic_notifier_chain_unregister() calls syncronize_rcu(), which can
sleep, which shouldn't be done from an atomic notifier.

Fix this by registering the notifier during init, and only unregister it
if the lowmemorykiller is unloaded.

Rebased to -next by Paul E. McKenney.
Rebased to -next again by Anton Vorontsov.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
940f77b07f85a4211fb149d6316a3cbd84d7227d 14-Feb-2012 David Rientjes <rientjes@google.com> staging: android, lowmemorykiller: convert to use oom_score_adj

/proc/pid/oom_adj is deprecated and will be removed in August 2012
according to Documentation/feature-removal-schedule.txt. Convert its
usage in the lowmemorykiller to use the new interface, oom_score_adj,
instead.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9823ec9ded836ee7ca4fe5ab7964b9cdc8af010c 06-Feb-2012 Anton Vorontsov <anton.vorontsov@linaro.org> staging: android/lowmemorykiller: Do not kill kernel threads

LMK should not try killing kernel threads.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
353416099128914a684e8bb81e7475d8c2961cc3 06-Feb-2012 Anton Vorontsov <anton.vorontsov@linaro.org> staging: android/lowmemorykiller: No need for task->signal check

task->signal == NULL is not possible, so no need for these checks.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
95670001188911f9d466875cd68e3681f39df38a 06-Feb-2012 Anton Vorontsov <anton.vorontsov@linaro.org> staging: android/lowmemorykiller: Better mm handling

LMK should not directly check for task->mm. The reason is that the
process' threads may exit or detach its mm via use_mm(), but other
threads may still have a valid mm. To catch this we use
find_lock_task_mm(), which walks up all threads and returns an
appropriate task (with lock held).

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
294b27119f2e20643e71a0c1a1b511320a11e4c3 06-Feb-2012 Anton Vorontsov <anton.vorontsov@linaro.org> staging: android/lowmemorykiller: Don't grab tasklist_lock

Grabbing tasklist_lock has its disadvantages, i.e. it blocks
process creation and destruction. If there are lots of processes,
blocking doesn't sound as a great idea.

For LMK, it is sufficient to surround tasks list traverse with
rcu_read_{,un}lock().

>From now on using force_sig() is not safe, as it can race with an
already exiting task, so we use send_sig() now. As a downside, it
won't kill PID namespace init processes, but that's not what we
want anyway.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e5d7965f88a3755b2d0c54768a17032ab3a72819 13-Jan-2012 Arve Hjønnevåg <arve@android.com> staging: android: lowmemorykiller: Don't wait more than one second for a process to die

If a process forked and the child process was killed by the
lowmemorykiller, the lowmemory killer would be disabled until
the parent process reaped the child or it died itself.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3bf5d65f4324510231cf33e5d75654f4fb1d1892 22-Dec-2011 Marco Navarra <fromenglish@gmail.com> Staging: android: fixed 80 characters warnings in lowmemorykiller.c

This patch fixes some 80 chatacters limit warnings in the lowmemorykiller.c file

Signed-off-by: Marco Navarra <fromenglish@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
cae9bf11ef0d92875b222f994a2cfd723991435a 23-Jun-2011 Colin Cross <ccross@android.com> android: lowmemorykiller: Fix arguments to lowmem_shrink

The arguments to shrink functions have changed, update
lowmem_shrink to match.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
71b2c82bdf67ab24716c536e10de436169d3574c 24-Nov-2010 Arve Hjønnevåg <arve@android.com> staging: android: lowmemorykiller: Ignore shmem pages in page-cache

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
06a1074e1c789a777732f8c432d913b0fedb8ff5 22-Aug-2010 Colin Cross <ccross@google.com> staging: android: lowmemorykiller: Update arguments of shrinker for 2.6.35

Signed-off-by: Colin Cross <ccross@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
eb943f6be011b33455b767880e13c34a2bb96a5e 07-May-2010 San Mehat <san@google.com> staging: android: lowmemorykiller: Remove bitrotted codepath

Now that we're murder-synchronous, this code path will never be
called (and if it does, it doesn't tell us anything useful other
than we killed a task that was already being killed by somebody
else but hadn't gotten its' signal yet)

Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4755b72e261478b48337e0e54c8448cbea32c5c8 05-May-2010 San Mehat <san@google.com> staging: android: lowmemkiller: Substantially reduce overhead during reclaim

This patch optimizes lowmemkiller to not do any work when it has an outstanding
kill-request. This greatly reduces the pressure on the task_list lock
(improving interactivity), as well as improving the vmscan performance
when under heavy memory pressure (by up to 20x in tests).

Note: For this enhancement to work, you need CONFIG_PROFILING

Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4964cd41cd966502c1e0c5bc929ed15c175f8218 27-Apr-2010 San Mehat <san@google.com> staging: android: lowmemorykiller: Don't try to kill the same pid over and over

Under certain circumstances, a process can take awhile to
handle a sig-kill (especially if it's in a scheduler group with
a very low share ratio). When this occurs, lowmemkiller returns
to vmscan indicating the process memory has been freed - even
though the process is still waiting to die. Since the memory
hasn't actually freed, lowmemkiller is called again shortly after,
and picks the same process to die; regardless of the fact that
it has already been 'scheduled' to die and the memory has already
been reported to vmscan as having been freed.

Solution is to check fatal_signal_pending() on the selected
task, and if it's already pending destruction return; indicating
to vmscan that no resources were freed on this pass.

Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
23687af9317c9c01d4609667d3566af7f5e71e65 28-Nov-2009 Corentin Chary <corentincj@iksaif.net> staging/android: fix build issues

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
355b0502f6efea0ff9492753888772c96972d2a3 30-Nov-2011 Greg Kroah-Hartman <gregkh@suse.de> Revert "Staging: android: delete android drivers"

This reverts commit b0a0ccfad85b3657fe999805df65f5cfe634ab8a.

Turns out I was wrong, we want these in the tree.

Note, I've disabled the drivers from the build at the moment, so other
patches can be applied to fix some build issues due to internal api
changes since the code was removed from the tree.

Cc: Arve Hjønnevåg <arve@android.com>
Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
b0a0ccfad85b3657fe999805df65f5cfe634ab8a 06-Oct-2009 Greg Kroah-Hartman <gregkh@suse.de> Staging: android: delete android drivers

These drivers are no longer being developed and the original authors
seem to have abandonded them and hence, do not want them in the mainline
kernel tree.

So sad :(

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
0984e56a65a29ad0700c5abf657327e73929ea1f 31-Jul-2009 Randy Dunlap <randy.dunlap@oracle.com> Staging: android: lowmemorykiller: fix module param errors

Move module_params to near the end of the source file so that
their references are already known/defined. Fixes build errors:

drivers/staging/android/lowmemorykiller.c: In function '__check_cost':
drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared (first use in this function)
drivers/staging/android/lowmemorykiller.c: At top level:
drivers/staging/android/lowmemorykiller.c:60: error: 'lowmem_shrinker' undeclared here (not in a function)
drivers/staging/android/lowmemorykiller.c:60: warning: type defaults to 'int' in declaration of 'type name'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
272bb3d8759448b2017aee149d226d7bf2d2bbb7 05-Jul-2009 Daniel Walker <dwalker@fifo99.com> Staging: android: lowmemorykiller: delete the decription file

Move the lowmemorykiller.txt into the actual source file which is really the
correct place for it, and delete lowmemorykiller.txt.

Signed-off-by: Daniel Walker <dwalker@fifo99.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
edd540ea92954f896bfb7ee0ebf5dfdde6e6cb41 05-Jul-2009 Daniel Walker <dwalker@fifo99.com> Staging: android: lowmemorykiller: remove a predefine

I moved the struct shrinker down so that the predefine isn't needed.

Signed-off-by: Daniel Walker <dwalker@fifo99.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
a6a9f81ccc9f5c86ccc22bbed1960a57d0316e8b 17-Jun-2009 David Rientjes <rientjes@google.com> Staging: android: lowmemorykiller.c: fix it for "oom: move oom_adj value from task_struct to mm_struct"

I'm about to merge "oom: move oom_adj value from task_struct to
mm_struct", and this fixup is needed to repair linux-next's
drivers/staging/android/lowmemorykiller.c.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1dbb5765acc7a6fe4bc1957c001037cc9d02ae03 12-May-2009 Greg Kroah-Hartman <gregkh@suse.de> Staging: android: lowmemorykiller: fix up remaining checkpatch warnings

This cleans up the last of the checkpatch warnings in the android
lowmemorykiller driver.


Cc: San Mehat <san@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
5d14a573a4da521d4ed7acd0c7d8a975887b2dd2 12-May-2009 David Rientjes <rientjes@google.com> Staging: android: lowmemorykiller: fix possible android low memory killer NULL pointer

get_mm_rss() atomically dereferences the actual without checking for a
NULL pointer, which is possible since task_lock() is not held.

Cc: San Mehat <san@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
34006e11ee406daa98aaf685d2de80c70e68decf 12-May-2009 David Rientjes <rientjes@google.com> Staging: android: lowmemorykiller: cleanup android low memory killer

Clean up the code in lowmem_shrink() for the Android low memory killer so
that it follows the kernel coding style.

It's unnecessary to check for p->oomkilladj >= min_adj if the selected
task's oomkilladj score is stored since get_mm_rss() will always be
greater than zero.

Cc: San Mehat <san@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
31d59a4198f3f07da8250dfb5b698eacfaf612e5 12-May-2009 Arve Hjønnevåg <arve@android.com> Staging: android: lowmemorykiller: Don't count free space unless it meets the specified limit by itself

From: Arve Hjønnevåg <arve@android.com>

This allows processes to be killed when the kernel evict cache pages in
an attempt to get more contiguous free memory.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Cc: David Rientjes <rientjes@google.com>
Cc: San Mehat <san@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
f501d00144328ca9e0521d159cf80ff5c9d21d77 12-May-2009 Arve Hjønnevåg <arve@android.com> Staging: android: lowmemorykiller: Only iterate over process list when needed.

Use NR_ACTIVE plus NR_INACTIVE as a size estimate for our fake cache
instead the sum of rss. Neither method is accurate.

Also skip the process scan, if the amount of memory available is above
the largest threshold set.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Cc: David Rientjes <rientjes@google.com>
Cc: San Mehat <san@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
08b88cc7844bf984e2e474134c207bb2c46c007d 20-Dec-2008 San Mehat <san@android.com> Staging: android: add lowmemorykiller driver

From: San Mehat <san@android.com>
Cc: Brian Swetland <swetland@google.com>
Cc: Robert Love <rlove@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>