oom: multi threaded process coredump don't make deadlock
[sfrench/cifs-2.6.git] / mm / oom_kill.c
index 31bd0c344fa771cb31a5479cbde4d7983678f614..0a4ca8a0234b5da6696235dd79c15ea1ed046a8f 100644 (file)
@@ -360,7 +360,7 @@ static struct task_struct *select_bad_process(unsigned long *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 (thread_group_empty(p) && (p->flags & PF_EXITING) && p->mm) {
                        if (p != current)
                                return ERR_PTR(-1UL);