From: KOSAKI Motohiro Date: Tue, 10 Aug 2010 00:19:42 +0000 (-0700) Subject: oom: multi threaded process coredump don't make deadlock X-Git-Tag: v2.6.36-rc1~407 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cef1d3523d33ebc35fc29e454b1f4bab953fabbf;p=pandora-kernel.git oom: multi threaded process coredump don't make deadlock Oleg pointed out current PF_EXITING check is wrong. Because PF_EXITING is per-thread flag, not per-process flag. He said, Two threads, group-leader L and its sub-thread T. T dumps the code. In this case both threads have ->mm != NULL, L has PF_EXITING. The first problem is, select_bad_process() always return -1 in this case (even if the caller is T, this doesn't matter). The second problem is that we should add TIF_MEMDIE to T, not L. I think we can remove this dubious PF_EXITING check. but as first step, This patch add the protection of multi threaded issue. Signed-off-by: KOSAKI Motohiro Cc: Oleg Nesterov Cc: Minchan Kim Cc: David Rientjes Cc: KAMEZAWA Hiroyuki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed