Skip to content

Commit

Permalink
[PATCH] out_of_memory() locking fix
Browse files Browse the repository at this point in the history
I seem to have lost this read_unlock().

While we're there, let's turn that interruptible sleep unto uninterruptible,
so we don't get a busywait if signal_pending().  (Again.  We seem to have a
habit of doing this).

Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Mar 2, 2006
1 parent b1e2d90 commit 140ffce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
}

out:
read_unlock(&tasklist_lock);
cpuset_unlock();
if (mm)
mmput(mm);
Expand All @@ -364,5 +365,5 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
* retry to allocate memory unless "p" is current
*/
if (!test_thread_flag(TIF_MEMDIE))
schedule_timeout_interruptible(1);
schedule_timeout_uninterruptible(1);
}

0 comments on commit 140ffce

Please sign in to comment.