diff options
author | David Rientjes <rientjes@google.com> | 2009-09-21 20:01:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:27 -0400 |
commit | b259fbde0a86085264c89aa2ce9c6e35792a1aad (patch) | |
tree | 43c43fcab1fd6eb897f7348a3b2c8071d61f2b6d /mm/page_alloc.c | |
parent | 4b02108ac1b3354a22b0d83c684797692efdc395 (diff) |
mm: update alloc_flags after oom killer has been called
It is possible for the oom killer to select current as the task to kill.
When this happens, alloc_flags needs to be updated accordingly to set
ALLOC_NO_WATERMARKS so the subsequent allocation attempt may use memory
reserves as the result of its thread having TIF_MEMDIE set if the
allocation is not __GFP_NOMEMALLOC.
Acked-by: Mel Gorman <mel@csn.ul.ie>
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>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e50c22545b8f..b6d0d09557ef 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1771,6 +1771,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, | |||
1771 | 1771 | ||
1772 | wake_all_kswapd(order, zonelist, high_zoneidx); | 1772 | wake_all_kswapd(order, zonelist, high_zoneidx); |
1773 | 1773 | ||
1774 | restart: | ||
1774 | /* | 1775 | /* |
1775 | * OK, we're below the kswapd watermark and have kicked background | 1776 | * OK, we're below the kswapd watermark and have kicked background |
1776 | * reclaim. Now things get more complex, so set up alloc_flags according | 1777 | * reclaim. Now things get more complex, so set up alloc_flags according |
@@ -1778,7 +1779,6 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, | |||
1778 | */ | 1779 | */ |
1779 | alloc_flags = gfp_to_alloc_flags(gfp_mask); | 1780 | alloc_flags = gfp_to_alloc_flags(gfp_mask); |
1780 | 1781 | ||
1781 | restart: | ||
1782 | /* This is the last chance, in general, before the goto nopage. */ | 1782 | /* This is the last chance, in general, before the goto nopage. */ |
1783 | page = get_page_from_freelist(gfp_mask, nodemask, order, zonelist, | 1783 | page = get_page_from_freelist(gfp_mask, nodemask, order, zonelist, |
1784 | high_zoneidx, alloc_flags & ~ALLOC_NO_WATERMARKS, | 1784 | high_zoneidx, alloc_flags & ~ALLOC_NO_WATERMARKS, |