mm: oom_kill: switch test-and-clear of known TIF_MEMDIE to clear
authorJohannes Weiner <hannes@cmpxchg.org>
Wed, 24 Jun 2015 23:57:10 +0000 (16:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 25 Jun 2015 00:49:43 +0000 (17:49 -0700)
exit_oom_victim() already knows that TIF_MEMDIE is set, and nobody else
can clear it concurrently.  Use clear_thread_flag() directly.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
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 b2f081fe4b1a615fbc36d9f50ad0936f190632a1..4b9547be91700e8d27f2dca024b77d4e7ae0448e 100644 (file)
@@ -435,8 +435,7 @@ void mark_oom_victim(struct task_struct *tsk)
  */
 void exit_oom_victim(void)
 {
-       if (!test_and_clear_thread_flag(TIF_MEMDIE))
-               return;
+       clear_thread_flag(TIF_MEMDIE);
 
        down_read(&oom_sem);
        /*