[Devel] [PATCH RHEL7 COMMIT] oom: do not ignore score of exiting tasks

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 29 08:28:59 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 4439834255824766734137c5090acd2fca6c0614
Author: Vladimir Davydov <vdavydov at virtuozzo.com>
Date:   Fri Apr 29 19:28:59 2016 +0400

    oom: do not ignore score of exiting tasks
    
    This patch effectively backports commit 6a618957ad17 ("mm: oom_kill:
    don't ignore oom score on exiting tasks").
    
    The reason I'm doing this is that it hurts oom berserker logic. When oom
    berserker enrages, it may kill quite a few tasks. All of them will soon
    end in do_exit, where they can get stuck trying to acquire some mutex
    (quite likely if a sort of fork bomb is running inside a container). Due
    to the check removed by this patch the next oom kill will surely select
    one of such tasks and hence is likely to timeout and so will the one
    after the next and so on until all such tasks have been marked with
    TIF_MEMDIE or exited. I.e. instead of killing more tasks we will be
    wasting our time marking those that have already been killed and waiting
    for them to exit. This may slow down oom berserker significantly. Since
    this PF_EXITING check was removed from oom_scan_process_thread upstream
    for a similar reason, let's zap it in our kernel too.
    
    Signed-off-by: Vladimir Davydov <vdavydov at virtuozzo.com>
    Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 mm/oom_kill.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index b21641f..8d1843f 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -344,14 +344,6 @@ enum oom_scan_t oom_scan_process_thread(struct task_struct *task,
 	if (oom_task_origin(task))
 		return OOM_SCAN_SELECT;
 
-	if (task->flags & PF_EXITING && !force_kill) {
-		/*
-		 * If this task is not being ptraced on exit, then wait for it
-		 * to finish before killing some other task unnecessarily.
-		 */
-		if (!(task->group_leader->ptrace & PT_TRACE_EXIT))
-			return OOM_SCAN_SELECT;
-	}
 	return OOM_SCAN_OK;
 }
 


More information about the Devel mailing list