diff options
Diffstat (limited to 'mm/page_alloc.c')
| -rw-r--r-- | mm/page_alloc.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9bd339eb04c6..a9649f4b261e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -1738,7 +1738,7 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, | |||
| 1738 | struct page *page; | 1738 | struct page *page; |
| 1739 | 1739 | ||
| 1740 | /* Acquire the OOM killer lock for the zones in zonelist */ | 1740 | /* Acquire the OOM killer lock for the zones in zonelist */ |
| 1741 | if (!try_set_zone_oom(zonelist, gfp_mask)) { | 1741 | if (!try_set_zonelist_oom(zonelist, gfp_mask)) { |
| 1742 | schedule_timeout_uninterruptible(1); | 1742 | schedule_timeout_uninterruptible(1); |
| 1743 | return NULL; | 1743 | return NULL; |
| 1744 | } | 1744 | } |
| @@ -1759,6 +1759,9 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, | |||
| 1759 | /* The OOM killer will not help higher order allocs */ | 1759 | /* The OOM killer will not help higher order allocs */ |
| 1760 | if (order > PAGE_ALLOC_COSTLY_ORDER) | 1760 | if (order > PAGE_ALLOC_COSTLY_ORDER) |
| 1761 | goto out; | 1761 | goto out; |
| 1762 | /* The OOM killer does not needlessly kill tasks for lowmem */ | ||
| 1763 | if (high_zoneidx < ZONE_NORMAL) | ||
| 1764 | goto out; | ||
| 1762 | /* | 1765 | /* |
| 1763 | * GFP_THISNODE contains __GFP_NORETRY and we never hit this. | 1766 | * GFP_THISNODE contains __GFP_NORETRY and we never hit this. |
| 1764 | * Sanity check for bare calls of __GFP_THISNODE, not real OOM. | 1767 | * Sanity check for bare calls of __GFP_THISNODE, not real OOM. |
| @@ -2052,15 +2055,23 @@ rebalance: | |||
| 2052 | if (page) | 2055 | if (page) |
| 2053 | goto got_pg; | 2056 | goto got_pg; |
| 2054 | 2057 | ||
| 2055 | /* | 2058 | if (!(gfp_mask & __GFP_NOFAIL)) { |
| 2056 | * The OOM killer does not trigger for high-order | 2059 | /* |
| 2057 | * ~__GFP_NOFAIL allocations so if no progress is being | 2060 | * The oom killer is not called for high-order |
| 2058 | * made, there are no other options and retrying is | 2061 | * allocations that may fail, so if no progress |
| 2059 | * unlikely to help. | 2062 | * is being made, there are no other options and |
| 2060 | */ | 2063 | * retrying is unlikely to help. |
| 2061 | if (order > PAGE_ALLOC_COSTLY_ORDER && | 2064 | */ |
| 2062 | !(gfp_mask & __GFP_NOFAIL)) | 2065 | if (order > PAGE_ALLOC_COSTLY_ORDER) |
| 2063 | goto nopage; | 2066 | goto nopage; |
| 2067 | /* | ||
| 2068 | * The oom killer is not called for lowmem | ||
| 2069 | * allocations to prevent needlessly killing | ||
| 2070 | * innocent tasks. | ||
| 2071 | */ | ||
| 2072 | if (high_zoneidx < ZONE_NORMAL) | ||
| 2073 | goto nopage; | ||
| 2074 | } | ||
| 2064 | 2075 | ||
| 2065 | goto restart; | 2076 | goto restart; |
| 2066 | } | 2077 | } |
| @@ -4089,8 +4100,6 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat, | |||
| 4089 | zone_seqlock_init(zone); | 4100 | zone_seqlock_init(zone); |
| 4090 | zone->zone_pgdat = pgdat; | 4101 | zone->zone_pgdat = pgdat; |
| 4091 | 4102 | ||
| 4092 | zone->prev_priority = DEF_PRIORITY; | ||
| 4093 | |||
| 4094 | zone_pcp_init(zone); | 4103 | zone_pcp_init(zone); |
| 4095 | for_each_lru(l) { | 4104 | for_each_lru(l) { |
| 4096 | INIT_LIST_HEAD(&zone->lru[l].list); | 4105 | INIT_LIST_HEAD(&zone->lru[l].list); |
