[lkml]   [2009]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH] page-allocator: Ensure that processes that have been OOM killed exit the page allocator (resend)
On Fri, 17 Jul 2009, Mel Gorman wrote:

> Ok, lets go with this patch then. Thanks

Ok, thanks, I'll add that as your acked-by and I'll write a formal patch
description for it.

mm: avoid endless looping for oom killed tasks

If a task is oom killed and still cannot find memory when trying with no
watermarks, it's better to fail the allocation attempt than to loop
endlessly. Direct reclaim has already failed and the oom killer will be a
no-op since current has yet to die, so there is no other alternative for
allocations that are not __GFP_NOFAIL.

Acked-by: Mel Gorman <>
Signed-off-by: David Rientjes <>
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1789,6 +1789,10 @@ rebalance:
if (p->flags & PF_MEMALLOC)
goto nopage;

+ /* Avoid allocations with no watermarks from looping endlessly */
+ if (test_thread_flag(TIF_MEMDIE) && !(gfp_mask & __GFP_NOFAIL))
+ goto nopage;
/* Try direct reclaim and then allocating */
page = __alloc_pages_direct_reclaim(gfp_mask, order,
zonelist, high_zoneidx,

 \ /
  Last update: 2009-07-17 12:33    [W:0.036 / U:1.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site