summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2017-05-03 17:52:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-03 18:52:08 -0400
commit491d79ae778f24dbf65f1f2178d4744d940d4093 (patch)
treee331158536949076d7b9b155fc663d2525f2fda8 /mm/page_alloc.c
parent3db65812d68883d1acfd20a9f2bc2cd13a7cd5c5 (diff)
mm: remove unnecessary back-off function when retrying page reclaim
The backoff mechanism is not needed. If we have MAX_RECLAIM_RETRIES loops without progress, we'll OOM anyway; backing off might cut one or two iterations off that in the rare OOM case. If we have intermittent success reclaiming a few pages, the backoff function gets reset also, and so is of little help in these scenarios. We might want a backoff function for when there IS progress, but not enough to be satisfactory. But this isn't that. Remove it. Link: http://lkml.kernel.org/r/20170228214007.5621-10-hannes@cmpxchg.org Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Jia He <hejianet@gmail.com> Cc: 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/page_alloc.c')
-rw-r--r--mm/page_alloc.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6994f28f769c..f82beddbd96f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3515,11 +3515,10 @@ bool gfp_pfmemalloc_allowed(gfp_t gfp_mask)
3515/* 3515/*
3516 * Checks whether it makes sense to retry the reclaim to make a forward progress 3516 * Checks whether it makes sense to retry the reclaim to make a forward progress
3517 * for the given allocation request. 3517 * for the given allocation request.
3518 * The reclaim feedback represented by did_some_progress (any progress during 3518 *
3519 * the last reclaim round) and no_progress_loops (number of reclaim rounds without 3519 * We give up when we either have tried MAX_RECLAIM_RETRIES in a row
3520 * any progress in a row) is considered as well as the reclaimable pages on the 3520 * without success, or when we couldn't even meet the watermark if we
3521 * applicable zone list (with a backoff mechanism which is a function of 3521 * reclaimed all remaining pages on the LRU lists.
3522 * no_progress_loops).
3523 * 3522 *
3524 * Returns true if a retry is viable or false to enter the oom path. 3523 * Returns true if a retry is viable or false to enter the oom path.
3525 */ 3524 */
@@ -3564,13 +3563,11 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order,
3564 bool wmark; 3563 bool wmark;
3565 3564
3566 available = reclaimable = zone_reclaimable_pages(zone); 3565 available = reclaimable = zone_reclaimable_pages(zone);
3567 available -= DIV_ROUND_UP((*no_progress_loops) * available,
3568 MAX_RECLAIM_RETRIES);
3569 available += zone_page_state_snapshot(zone, NR_FREE_PAGES); 3566 available += zone_page_state_snapshot(zone, NR_FREE_PAGES);
3570 3567
3571 /* 3568 /*
3572 * Would the allocation succeed if we reclaimed the whole 3569 * Would the allocation succeed if we reclaimed all
3573 * available? 3570 * reclaimable pages?
3574 */ 3571 */
3575 wmark = __zone_watermark_ok(zone, order, min_wmark, 3572 wmark = __zone_watermark_ok(zone, order, min_wmark,
3576 ac_classzone_idx(ac), alloc_flags, available); 3573 ac_classzone_idx(ac), alloc_flags, available);