diff options
author | David Rientjes <rientjes@google.com> | 2009-06-16 18:32:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 22:47:43 -0400 |
commit | 82553a937f12352c26fe457510ebab3f512cd3fa (patch) | |
tree | c3df31e9953d5f56491576ba019fdc2cd87af926 | |
parent | 4d8b9135c30ccbe46e621fefd862969819003fd6 (diff) |
oom: invoke oom killer for __GFP_NOFAIL
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: Nick Piggin <npiggin@suse.de>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/page_alloc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c95a77cd581b..c5fb017c9430 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1561,7 +1561,7 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, | |||
1561 | goto out; | 1561 | goto out; |
1562 | 1562 | ||
1563 | /* The OOM killer will not help higher order allocs */ | 1563 | /* The OOM killer will not help higher order allocs */ |
1564 | if (order > PAGE_ALLOC_COSTLY_ORDER) | 1564 | if (order > PAGE_ALLOC_COSTLY_ORDER && !(gfp_mask & __GFP_NOFAIL)) |
1565 | goto out; | 1565 | goto out; |
1566 | 1566 | ||
1567 | /* Exhausted what can be done so it's blamo time */ | 1567 | /* Exhausted what can be done so it's blamo time */ |
@@ -1781,11 +1781,13 @@ rebalance: | |||
1781 | goto got_pg; | 1781 | goto got_pg; |
1782 | 1782 | ||
1783 | /* | 1783 | /* |
1784 | * The OOM killer does not trigger for high-order allocations | 1784 | * The OOM killer does not trigger for high-order |
1785 | * but if no progress is being made, there are no other | 1785 | * ~__GFP_NOFAIL allocations so if no progress is being |
1786 | * options and retrying is unlikely to help | 1786 | * made, there are no other options and retrying is |
1787 | * unlikely to help. | ||
1787 | */ | 1788 | */ |
1788 | if (order > PAGE_ALLOC_COSTLY_ORDER) | 1789 | if (order > PAGE_ALLOC_COSTLY_ORDER && |
1790 | !(gfp_mask & __GFP_NOFAIL)) | ||
1789 | goto nopage; | 1791 | goto nopage; |
1790 | 1792 | ||
1791 | goto restart; | 1793 | goto restart; |