]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/oom_kill.c
mm,oom_reaper: do not attempt to reap a task twice
[karo-tx-linux.git] / mm / oom_kill.c
index 87fad956c96bbb2c9bfd977c7c75860cedcb2eea..45097f5a8f303c08c26c6f1e8847fc5a0c9c2117 100644 (file)
@@ -578,20 +578,11 @@ static void oom_reap_task(struct task_struct *tsk)
        if (attempts <= MAX_OOM_REAP_RETRIES)
                goto done;
 
+       /* Ignore this mm because somebody can't call up_write(mmap_sem). */
+       set_bit(MMF_OOM_REAPED, &mm->flags);
+
        pr_info("oom_reaper: unable to reap pid:%d (%s)\n",
                task_pid_nr(tsk), tsk->comm);
-
-       /*
-        * If we've already tried to reap this task in the past and
-        * failed it probably doesn't make much sense to try yet again
-        * so hide the mm from the oom killer so that it can move on
-        * to another task with a different mm struct.
-        */
-       if (test_and_set_bit(MMF_OOM_NOT_REAPABLE, &mm->flags)) {
-               pr_info("oom_reaper: giving up pid:%d (%s)\n",
-                       task_pid_nr(tsk), tsk->comm);
-               set_bit(MMF_OOM_REAPED, &mm->flags);
-       }
        debug_show_all_locks();
 
 done: