mm: oom_kill: remove unnecessary locking in oom_enable()
authorJohannes Weiner <hannes@cmpxchg.org>
Wed, 24 Jun 2015 23:57:04 +0000 (16:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 25 Jun 2015 00:49:43 +0000 (17:49 -0700)
Setting oom_killer_disabled to false is atomic, there is no need for
further synchronization with ongoing allocations trying to OOM-kill.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/oom_kill.c

index 2b665da1b3c92070de5e9d8ee6864d843847115c..73763e489e86b24cfc2a51ef7b142fffccdffc6d 100644 (file)
@@ -488,9 +488,7 @@ bool oom_killer_disable(void)
  */
 void oom_killer_enable(void)
 {
-       down_write(&oom_sem);
        oom_killer_disabled = false;
-       up_write(&oom_sem);
 }
 
 #define K(x) ((x) << (PAGE_SHIFT-10))