From: Johannes Weiner Date: Wed, 24 Jun 2015 23:57:04 +0000 (-0700) Subject: mm: oom_kill: remove unnecessary locking in oom_enable() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3f5ab8cfbf15e8e02838ffc3549191351305df0e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mm: oom_kill: remove unnecessary locking in oom_enable() 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 Acked-by: Michal Hocko Acked-by: David Rientjes Cc: Tetsuo Handa Cc: Andrea Arcangeli Cc: Dave Chinner Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 2b665da1b3c9..73763e489e86 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -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))