lkml.org 
[lkml]   [2009]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] page-allocator: Ensure that processes that have been OOM killed exit the page allocator (resend)
On Wed, 15 Jul 2009, David Rientjes wrote:

> This only works for GFP_ATOMIC since the next iteration of the page
> allocator will (probably) fail reclaim and simply invoke the oom killer
> again, which will notice current has TIF_MEMDIE set and choose to do
> nothing, at which time the allocator simply loops again.
>

In other words, I'd propose this as an alternative patch.

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-15 23:03    [W:0.420 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site