linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch] mm, page_alloc: allow __GFP_NOFAIL to allocate below watermarks after reclaim
@ 2013-12-09 22:03 David Rientjes
  2013-12-10  7:50 ` Mel Gorman
  0 siblings, 1 reply; 5+ messages in thread
From: David Rientjes @ 2013-12-09 22:03 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Mel Gorman, Michal Hocko, linux-mm, linux-kernel

If direct reclaim has failed to free memory, __GFP_NOFAIL allocations
can potentially loop forever in the page allocator.  In this case, it's
better to give them the ability to access below watermarks so that they
may allocate similar to the same privilege given to GFP_ATOMIC
allocations.

We're careful to ensure this is only done after direct reclaim has had
the chance to free memory, however.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/page_alloc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2629,6 +2629,11 @@ rebalance:
 						pages_reclaimed)) {
 		/* Wait for some write requests to complete then retry */
 		wait_iff_congested(preferred_zone, BLK_RW_ASYNC, HZ/50);
+
+		/* Allocations that cannot fail must allocate from somewhere */
+		if (gfp_mask & __GFP_NOFAIL)
+			alloc_flags |= ALLOC_HARDER;
+
 		goto rebalance;
 	} else {
 		/*

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2013-12-12  1:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09 22:03 [patch] mm, page_alloc: allow __GFP_NOFAIL to allocate below watermarks after reclaim David Rientjes
2013-12-10  7:50 ` Mel Gorman
2013-12-10 23:03   ` David Rientjes
2013-12-11  9:26     ` Mel Gorman
2013-12-12  1:10     ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).