Otherwise, we might end up selecting the same process over and over
again in case it got stuck somewhere in exit path for some reason.

Signed-off-by: Vladimir Davydov <[email protected]>
---
 mm/oom_kill.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 2402fcceda6e..b21641ff508e 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -847,6 +847,9 @@ void oom_kill_process(struct task_struct *p, gfp_t 
gfp_mask, int order,
 
                        if (child->mm == p->mm)
                                continue;
+                       if (!child->mm ||
+                           test_tsk_thread_flag(child, TIF_MEMDIE))
+                               continue;
                        /*
                         * oom_badness() returns 0 if the thread is unkillable
                         */
-- 
2.1.4

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to