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)
committerColin Cross <ccross@android.com>
Thu, 30 Sep 2010 00:49:33 +0000 (17:49 -0700)
commitfdcec72817775d290c381cc0d7da12c10fca3a11
tree03b5cc47fbc1274182e28f26339a83c28d72bb59
parent3c455b77679043674d53e2060787ad92ed3eb9db
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>
drivers/staging/android/lowmemorykiller.c