public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch -mmotm] mm: invoke oom killer for __GFP_NOFAIL
@ 2009-05-09 22:46 David Rientjes
  2009-05-10 23:42 ` Rik van Riel
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: David Rientjes @ 2009-05-09 22:46 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, Peter Zijlstra, Nick Piggin, Christoph Lameter,
	Dave Hansen, linux-kernel

The oom killer must be invoked regardless of the order if the allocation
is __GFP_NOFAIL, otherwise it will loop forever when reclaim fails to
free some memory.

Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/page_alloc.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1547,7 +1547,7 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
 		goto out;
 
 	/* The OOM killer will not help higher order allocs */
-	if (order > PAGE_ALLOC_COSTLY_ORDER)
+	if (order > PAGE_ALLOC_COSTLY_ORDER && !(gfp_mask & __GFP_NOFAIL))
 		goto out;
 
 	/* Exhausted what can be done so it's blamo time */
@@ -1763,16 +1763,12 @@ rebalance:
 					migratetype);
 			if (page)
 				goto got_pg;
+			if ((gfp_mask & __GFP_NOFAIL) ||
+					order <= PAGE_ALLOC_COSTLY_ORDER)
+				goto restart;
 
-			/*
-			 * The OOM killer does not trigger for high-order allocations
-			 * but if no progress is being made, there are no other
-			 * options and retrying is unlikely to help
-			 */
-			if (order > PAGE_ALLOC_COSTLY_ORDER)
-				goto nopage;
-
-			goto restart;
+			/* No freeing is possible so just fail */
+			goto nopage;
 		}
 	}
 

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2009-05-12 17:35 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-09 22:46 [patch -mmotm] mm: invoke oom killer for __GFP_NOFAIL David Rientjes
2009-05-10 23:42 ` Rik van Riel
2009-05-11  7:29 ` Minchan Kim
2009-05-11  8:40   ` David Rientjes
2009-05-11  9:12     ` Minchan Kim
2009-05-11 11:21       ` Minchan Kim
2009-05-11 13:38         ` Mel Gorman
2009-05-11 14:00           ` Minchan Kim
2009-05-11 19:32             ` David Rientjes
2009-05-11 23:48               ` Minchan Kim
2009-05-11 21:32             ` Mel Gorman
2009-05-11 23:41               ` Minchan Kim
2009-05-11 10:40 ` Mel Gorman
2009-05-11 19:37   ` David Rientjes
2009-05-11 20:40 ` Andrew Morton
2009-05-12 12:42   ` Jens Axboe
2009-05-12 13:05     ` Nick Piggin
2009-05-12 16:37       ` Jens Axboe
2009-05-12 16:49         ` Nick Piggin
2009-05-12 17:35           ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox