diff options
author | Weijie Yang <weijie.yang@samsung.com> | 2014-04-07 18:37:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:35:50 -0400 |
commit | 9bbc04eeb01fcb5c20bb10f34989665df7200163 (patch) | |
tree | bafb3ff4118bb08c96f2a584c6cdee59aa873a4d /mm | |
parent | 619d0d76c1ee943f171c7d4fc021ec7602388579 (diff) |
mm/vmscan: do not check compaction_ready on promoted zones
We abort direct reclaim if we find the zone is ready for compaction.
Sometimes the zone is just a promoted highmem zone to force a scan of
highmem, which is not the intended zone the caller want to allocate a
page from. In this situation, setting aborted_reclaim to indicate the
caller turned back to retry the allocation is waste of time and could
cause a loop in __alloc_pages_slowpath().
This patch does not check compaction_ready() on promoted zones to avoid
the above situation. Only set aborted_reclaim if the caller intended
zone is ready for compaction.
Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmscan.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 1c51e4f52fd9..06879ead7380 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2318,6 +2318,7 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc) | |||
2318 | struct shrink_control shrink = { | 2318 | struct shrink_control shrink = { |
2319 | .gfp_mask = sc->gfp_mask, | 2319 | .gfp_mask = sc->gfp_mask, |
2320 | }; | 2320 | }; |
2321 | enum zone_type requested_highidx = gfp_zone(sc->gfp_mask); | ||
2321 | 2322 | ||
2322 | /* | 2323 | /* |
2323 | * If the number of buffer_heads in the machine exceeds the maximum | 2324 | * If the number of buffer_heads in the machine exceeds the maximum |
@@ -2358,7 +2359,8 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc) | |||
2358 | * noticeable problem, like transparent huge | 2359 | * noticeable problem, like transparent huge |
2359 | * page allocations. | 2360 | * page allocations. |
2360 | */ | 2361 | */ |
2361 | if (compaction_ready(zone, sc)) { | 2362 | if ((zonelist_zone_idx(z) <= requested_highidx) |
2363 | && compaction_ready(zone, sc)) { | ||
2362 | aborted_reclaim = true; | 2364 | aborted_reclaim = true; |
2363 | continue; | 2365 | continue; |
2364 | } | 2366 | } |