]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/oom_kill.c
mm,oom: make oom_killer_disable() killable
[karo-tx-linux.git] / mm / oom_kill.c
index fde3d374c0afa79d229d28bc7a0fec56ad99be34..06f7e1707847fe11250bdb05d1ed3390cb96e5bb 100644 (file)
@@ -455,15 +455,11 @@ void exit_oom_victim(void)
 bool oom_killer_disable(void)
 {
        /*
-        * Make sure to not race with an ongoing OOM killer
-        * and that the current is not the victim.
+        * Make sure to not race with an ongoing OOM killer. Check that the
+        * current is not killed (possibly due to sharing the victim's memory).
         */
-       mutex_lock(&oom_lock);
-       if (test_thread_flag(TIF_MEMDIE)) {
-               mutex_unlock(&oom_lock);
+       if (mutex_lock_killable(&oom_lock))
                return false;
-       }
-
        oom_killer_disabled = true;
        mutex_unlock(&oom_lock);