From: Oleg Nesterov Date: Sat, 13 Dec 2014 00:56:27 +0000 (-0800) Subject: oom: kill the insufficient and no longer needed PT_TRACE_EXIT check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6a2d5679b4a852a3bf80c570644456ab466ab714;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git oom: kill the insufficient and no longer needed PT_TRACE_EXIT check After the previous patch we can remove the PT_TRACE_EXIT check in oom_scan_process_thread(), it was added to handle the case when the coredumping was "frozen" by ptrace, but it doesn't really work. If nothing else, we would need to check all threads which could share the same ->mm to make it more or less correct. Signed-off-by: Oleg Nesterov Cc: Cong Wang Cc: David Rientjes Acked-by: Michal Hocko Cc: "Rafael J. Wysocki" Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/oom_kill.c b/mm/oom_kill.c index f694ef0d9f9a..d503e9ce1c7b 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -281,14 +281,9 @@ enum oom_scan_t oom_scan_process_thread(struct task_struct *task, if (oom_task_origin(task)) return OOM_SCAN_SELECT; - if (task_will_free_mem(task) && !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_ABORT; - } + if (task_will_free_mem(task) && !force_kill) + return OOM_SCAN_ABORT; + return OOM_SCAN_OK; }