[Devel] [PATCH RHEL7 COMMIT] oom: do not select child that has already been killed

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 29 08:28:58 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.10.1.vz7.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.10.1.vz7.12.15
------>
commit 1ed898800a3069f582ea3f82e0e920ecb4f0740c
Author: Vladimir Davydov <vdavydov at virtuozzo.com>
Date:   Fri Apr 29 19:28:57 2016 +0400

    oom: do not select child that has already been killed
    
    Patchset description:
    A few fixes for oom killer
    
    This is for https://jira.sw.ru/browse/PSBM-40842
    
    Vladimir Davydov (5):
      oom: do not select child that has already been killed
      mm: memcontrol: check more carefully if current is oom killed
      oom: do not ignore score of exiting tasks
      oom: zap unused oom_scan_process_thread arguments
      oom: make berserker more aggressive
    
    ======================
    This patch description:
    
    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 <vdavydov at virtuozzo.com>
    Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 mm/oom_kill.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 2402fcc..b21641f 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
 			 */


More information about the Devel mailing list