Files
linux/mm
Oleg Nesterov 84416db676 oom: task->mm == NULL doesn't mean the memory was freed
commit c027a474a6 upstream.

exit_mm() sets ->mm == NULL then it does mmput()->exit_mmap() which
frees the memory.

However select_bad_process() checks ->mm != NULL before TIF_MEMDIE,
so it continues to kill other tasks even if we have the oom-killed
task freeing its memory.

Change select_bad_process() to check ->mm after TIF_MEMDIE, but skip
the tasks which have already passed exit_notify() to ensure a zombie
with TIF_MEMDIE set can't block oom-killer. Alternatively we could
probably clear TIF_MEMDIE after exit_mmap().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-04 21:58:42 -07:00
..
2011-06-03 18:24:58 -04:00
2011-05-26 09:20:31 -07:00
2011-05-26 09:20:31 -07:00
2011-05-25 08:39:18 -07:00
2011-07-08 21:14:44 -07:00
2011-06-27 18:00:12 -07:00
2011-05-25 08:39:05 -07:00
2011-07-19 22:09:31 -07:00