lkml.org 
[lkml]   [2007]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 14 Aug 2007 08:30:29 -0700
FromChristoph Lameter <>
Subject[RFC 8/9] Reclaim on an atomic allocation if necessary
Simply call reclaim if we get to a point where we cannot perform
the desired atomic allocation. If the reclaim is successful then
restart the allocation.

This will allow atomic allocs to not run out of memory. We reclaim clean
pages instead. If we are in an interrupt then the interrupt holdoff
will be long since reclaim processing is intensive. However, we will
no longer OOM.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

---
mm/page_alloc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c 2007-08-14 07:42:09.000000000 -0700
+++ linux-2.6/mm/page_alloc.c 2007-08-14 07:53:34.000000000 -0700
@@ -1326,8 +1326,12 @@ nofail_alloc:
}

/* Atomic allocations - we can't balance anything */
- if (!wait)
+ if (!wait) {
+ if (try_to_free_pages(zonelist->zones, order, gfp_mask
+ | __GFP_NOMEMALLOC))
+ goto restart;
goto nopage;
+ }

cond_resched();

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-14 17:39    [from the cache]
©2003-2010