sctp: do not update a_rwnd if we are not issuing a sack
[cascardo/linux.git] / mm / oom_kill.c
index fde3d37..06f7e17 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);