Skip to content

Commit 140ffce

Browse files
Andrew MortonLinus Torvalds
authored andcommitted
[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>
1 parent b1e2d90 commit 140ffce

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎mm/oom_kill.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
355355
}
356356

357357
out:
358+
read_unlock(&tasklist_lock);
358359
cpuset_unlock();
359360
if (mm)
360361
mmput(mm);
@@ -364,5 +365,5 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
364365
* retry to allocate memory unless "p" is current
365366
*/
366367
if (!test_thread_flag(TIF_MEMDIE))
367-
schedule_timeout_interruptible(1);
368+
schedule_timeout_uninterruptible(1);
368369
}

0 commit comments

Comments
 (0)