|
@@ -455,15 +455,11 @@ void exit_oom_victim(void)
|
|
bool oom_killer_disable(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;
|
|
return false;
|
|
- }
|
|
|
|
-
|
|
|
|
oom_killer_disabled = true;
|
|
oom_killer_disabled = true;
|
|
mutex_unlock(&oom_lock);
|
|
mutex_unlock(&oom_lock);
|
|
|
|
|