diff options
author | San Mehat <san@google.com> | 2010-04-26 15:11:04 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2012-02-14 11:30:23 -0800 |
commit | f7983488cb4c691cb58e9d4c81bdc64af3c6c857 (patch) | |
tree | df8d11bb321d57918072482f68669ea6c3993bc7 /drivers | |
parent | 667dffa787a87ef4ea43cc65957ce96077fdcd0a (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/android/lowmemorykiller.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index 2d8d2b79610..f4960dd3b26 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -168,6 +168,12 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) p->pid, p->comm, oom_adj, tasksize); } if (selected) { + if (fatal_signal_pending(selected)) { + pr_warning("process %d is suffering a slow death\n", + selected->pid); + read_unlock(&tasklist_lock); + return rem; + } lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n", selected->pid, selected->comm, selected_oom_adj, selected_tasksize); |