path: root/mm
diff options
authorDavid Rientjes <>2014-08-06 16:07:58 -0700
committerLinus Torvalds <>2014-08-06 18:01:21 -0700
commitfb794bcbb4e5552242f9a4c5e1ffe4c6da29a968 (patch)
tree00365c507d5dd171ef18ac0341f49564c1637c57 /mm
parentd0177639310d23c7739500df3c6ce6fdfe34acec (diff)
mm, oom: remove unnecessary exit_state check
The oom killer scans each process and determines whether it is eligible for oom kill or whether the oom killer should abort because of concurrent memory freeing. It will abort when an eligible process is found to have TIF_MEMDIE set, meaning it has already been oom killed and we're waiting for it to exit. Processes with task->mm == NULL should not be considered because they are either kthreads or have already detached their memory and killing them would not lead to memory freeing. That memory is only freed after exit_mm() has returned, however, and not when task->mm is first set to NULL. Clear TIF_MEMDIE after exit_mm()'s mmput() so that an oom killed process is no longer considered for oom kill, but only until exit_mm() has returned. This was fragile in the past because it relied on exit_notify() to be reached before no longer considering TIF_MEMDIE processes. Signed-off-by: David Rientjes <> Cc: Oleg Nesterov <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm')
1 files changed, 0 insertions, 2 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index d33aca1552ad..1e11df8fa7ec 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -258,8 +258,6 @@ enum oom_scan_t oom_scan_process_thread(struct task_struct *task,
unsigned long totalpages, const nodemask_t *nodemask,
bool force_kill)
- if (task->exit_state)
if (oom_unkillable_task(task, NULL, nodemask))