staging: android: lowmemorykiller: Don't try to kill the same pid over and over
authorSan Mehat <san@google.com>
Mon, 26 Apr 2010 22:11:04 +0000 (15:11 -0700)
committerGrazvydas Ignotas <notasas@gmail.com>
Wed, 25 Apr 2012 22:23:29 +0000 (01:23 +0300)
commit60798570ce10cd5b56ed382af1e118c72f77487c
tree9d0f5ad5d786e59f5a8ddc7613c171c341637ab7
parent7422724ee95c18b79b6c0a7b09ec062f8f0cbf32
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>
drivers/staging/android/lowmemorykiller.c