Skip to content

Commit

Permalink
mm: oom_kill: switch test-and-clear of known TIF_MEMDIE to clear
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: David Rientjes <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
hnaz authored and torvalds committed Jun 25, 2015
1 parent 16e9519 commit 4640277
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/*
Expand Down

0 comments on commit 4640277

Please sign in to comment.