]> git.baikalelectronics.ru Git - kernel.git/commit
android, lmk: avoid setting TIF_MEMDIE if process has already exited
authorDavid Rientjes <rientjes@google.com>
Tue, 28 Apr 2015 22:50:46 +0000 (15:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 13:22:10 +0000 (15:22 +0200)
commit48cd1a7af4bfc3cb7eb7d1acf2c2c9233c74a567
tree436793d76dd5a9528f14e9df41664d49e1c5f49e
parent6bacfd3c48f3ed4de599d747d60e36f59a5039a0
android, lmk: avoid setting TIF_MEMDIE if process has already exited

TIF_MEMDIE should not be set on a process if it does not have a valid
->mm, and this is protected by task_lock().

If TIF_MEMDIE gets set after the mm has detached, and the process fails to
exit, then the oom killer will defer forever waiting for it to exit.

Make sure that the mm is still valid before setting TIF_MEMDIE by way of
mark_tsk_oom_victim().

Cc: "Arve Hjønnevåg" <arve@android.com>
Cc: Riley Andrews <riandrews@android.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/lowmemorykiller.c