[PATCH] out_of_memory() locking fix

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 <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Andrew Morton 2006-03-02 02:54:28 -08:00 committed by Linus Torvalds
parent b1e2d907cb
commit 140ffcec4d

View file

@ -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);
@ -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);
}