]> git.kernelconcepts.de Git - karo-tx-linux.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)
commite1099a69a6244baa7d24ce52627bab253a3b52ac
tree436793d76dd5a9528f14e9df41664d49e1c5f49e
parent56f40e521047ae8623ad5dcbb5a08ad91684cab6
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