aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorAndrey Vagin <avagin@openvz.org>2011-03-22 16:30:11 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-27 11:35:47 -0700
commitd00451caef12248e498ba15cc9ba04192a66f3e3 (patch)
tree5e9cfbe38bd33d2d6b6141544f5dc62a5e9fff5e /mm
parent1163d4ca61ff2544f66b2663c6050f5f00c01fc1 (diff)
oom: skip zombies when iterating tasklist
commit 30e2b41f20b6238f51e7cffb879c7a0f0073f5fe upstream. We shouldn't defer oom killing if a thread has already detached its ->mm and still has TIF_MEMDIE set. Memory needs to be freed, so find kill other threads that pin the same ->mm or find another task to kill. Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: David Rientjes <rientjes@google.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'mm')
-rw-r--r--mm/oom_kill.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index b5a7b5f46e7..d7f345e47e7 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -299,6 +299,8 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
do_each_thread(g, p) {
unsigned int points;
+ if (!p->mm)
+ continue;
if (oom_unkillable_task(p, mem, nodemask))
continue;
@@ -324,7 +326,7 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
* the process of exiting and releasing its resources.
* Otherwise we could get an easy OOM deadlock.
*/
- if ((p->flags & PF_EXITING) && p->mm) {
+ if (p->flags & PF_EXITING) {
if (p != current)
return ERR_PTR(-1UL);