diff options
-rw-r--r-- | mm/vmscan.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 3b8ede882396..25f90383b391 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2217,7 +2217,8 @@ static inline bool compaction_ready(struct zone *zone, struct scan_control *sc) | |||
2217 | * | 2217 | * |
2218 | * This function returns true if a zone is being reclaimed for a costly | 2218 | * This function returns true if a zone is being reclaimed for a costly |
2219 | * high-order allocation and compaction is ready to begin. This indicates to | 2219 | * high-order allocation and compaction is ready to begin. This indicates to |
2220 | * the caller that it should retry the allocation or fail. | 2220 | * the caller that it should consider retrying the allocation instead of |
2221 | * further reclaim. | ||
2221 | */ | 2222 | */ |
2222 | static bool shrink_zones(int priority, struct zonelist *zonelist, | 2223 | static bool shrink_zones(int priority, struct zonelist *zonelist, |
2223 | struct scan_control *sc) | 2224 | struct scan_control *sc) |
@@ -2226,7 +2227,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist, | |||
2226 | struct zone *zone; | 2227 | struct zone *zone; |
2227 | unsigned long nr_soft_reclaimed; | 2228 | unsigned long nr_soft_reclaimed; |
2228 | unsigned long nr_soft_scanned; | 2229 | unsigned long nr_soft_scanned; |
2229 | bool should_abort_reclaim = false; | 2230 | bool aborted_reclaim = false; |
2230 | 2231 | ||
2231 | for_each_zone_zonelist_nodemask(zone, z, zonelist, | 2232 | for_each_zone_zonelist_nodemask(zone, z, zonelist, |
2232 | gfp_zone(sc->gfp_mask), sc->nodemask) { | 2233 | gfp_zone(sc->gfp_mask), sc->nodemask) { |
@@ -2252,7 +2253,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist, | |||
2252 | * allocations. | 2253 | * allocations. |
2253 | */ | 2254 | */ |
2254 | if (compaction_ready(zone, sc)) { | 2255 | if (compaction_ready(zone, sc)) { |
2255 | should_abort_reclaim = true; | 2256 | aborted_reclaim = true; |
2256 | continue; | 2257 | continue; |
2257 | } | 2258 | } |
2258 | } | 2259 | } |
@@ -2274,7 +2275,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist, | |||
2274 | shrink_zone(priority, zone, sc); | 2275 | shrink_zone(priority, zone, sc); |
2275 | } | 2276 | } |
2276 | 2277 | ||
2277 | return should_abort_reclaim; | 2278 | return aborted_reclaim; |
2278 | } | 2279 | } |
2279 | 2280 | ||
2280 | static bool zone_reclaimable(struct zone *zone) | 2281 | static bool zone_reclaimable(struct zone *zone) |
@@ -2328,7 +2329,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
2328 | struct zoneref *z; | 2329 | struct zoneref *z; |
2329 | struct zone *zone; | 2330 | struct zone *zone; |
2330 | unsigned long writeback_threshold; | 2331 | unsigned long writeback_threshold; |
2331 | bool should_abort_reclaim; | 2332 | bool aborted_reclaim; |
2332 | 2333 | ||
2333 | get_mems_allowed(); | 2334 | get_mems_allowed(); |
2334 | delayacct_freepages_start(); | 2335 | delayacct_freepages_start(); |
@@ -2340,9 +2341,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
2340 | sc->nr_scanned = 0; | 2341 | sc->nr_scanned = 0; |
2341 | if (!priority) | 2342 | if (!priority) |
2342 | disable_swap_token(sc->target_mem_cgroup); | 2343 | disable_swap_token(sc->target_mem_cgroup); |
2343 | should_abort_reclaim = shrink_zones(priority, zonelist, sc); | 2344 | aborted_reclaim = shrink_zones(priority, zonelist, sc); |
2344 | if (should_abort_reclaim) | ||
2345 | break; | ||
2346 | 2345 | ||
2347 | /* | 2346 | /* |
2348 | * Don't shrink slabs when reclaiming memory from | 2347 | * Don't shrink slabs when reclaiming memory from |
@@ -2409,8 +2408,8 @@ out: | |||
2409 | if (oom_killer_disabled) | 2408 | if (oom_killer_disabled) |
2410 | return 0; | 2409 | return 0; |
2411 | 2410 | ||
2412 | /* Aborting reclaim to try compaction? don't OOM, then */ | 2411 | /* Aborted reclaim to try compaction? don't OOM, then */ |
2413 | if (should_abort_reclaim) | 2412 | if (aborted_reclaim) |
2414 | return 1; | 2413 | return 1; |
2415 | 2414 | ||
2416 | /* top priority shrink_zones still had more to do? don't OOM, then */ | 2415 | /* top priority shrink_zones still had more to do? don't OOM, then */ |