From 97ae19821c638183a533583eb4668da9127bd0a7 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 22 Oct 2015 09:03:11 +1100 Subject: [PATCH] mm-oom_kill-fix-the-wrong-task-mm-==-mm-checks-in-oom_kill_process-fix document process_shares_mm() a bit Cc: David Rientjes Cc: Kyle Walker Cc: Michal Hocko Cc: Oleg Nesterov Cc: Stanislav Kozina Cc: Tetsuo Handa Signed-off-by: Andrew Morton --- mm/oom_kill.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 52abb78633d5..d13a33918fa2 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -483,6 +483,12 @@ void oom_killer_enable(void) oom_killer_disabled = false; } +/* + * task->mm can be NULL if the task is the exited group leader. So to + * determine whether the task is using a particular mm, we examine all the + * task's threads: if one of those is using this mm then this task was also + * using it. + */ static bool process_shares_mm(struct task_struct *p, struct mm_struct *mm) { struct task_struct *t; -- 2.39.5