Commit 491d79ae authored by Johannes Weiner's avatar Johannes Weiner Committed by Linus Torvalds

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.orgSigned-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
Acked-by: default avatarHillf Danton <hillf.zj@alibaba-inc.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Cc: Jia He <hejianet@gmail.com>
Cc: Mel Gorman <mgorman@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3db65812
...@@ -3515,11 +3515,10 @@ bool gfp_pfmemalloc_allowed(gfp_t gfp_mask) ...@@ -3515,11 +3515,10 @@ bool gfp_pfmemalloc_allowed(gfp_t gfp_mask)
/* /*
* Checks whether it makes sense to retry the reclaim to make a forward progress * Checks whether it makes sense to retry the reclaim to make a forward progress
* for the given allocation request. * for the given allocation request.
* The reclaim feedback represented by did_some_progress (any progress during *
* the last reclaim round) and no_progress_loops (number of reclaim rounds without * We give up when we either have tried MAX_RECLAIM_RETRIES in a row
* any progress in a row) is considered as well as the reclaimable pages on the * without success, or when we couldn't even meet the watermark if we
* applicable zone list (with a backoff mechanism which is a function of * reclaimed all remaining pages on the LRU lists.
* no_progress_loops).
* *
* Returns true if a retry is viable or false to enter the oom path. * Returns true if a retry is viable or false to enter the oom path.
*/ */
...@@ -3564,13 +3563,11 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order, ...@@ -3564,13 +3563,11 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order,
bool wmark; bool wmark;
available = reclaimable = zone_reclaimable_pages(zone); available = reclaimable = zone_reclaimable_pages(zone);
available -= DIV_ROUND_UP((*no_progress_loops) * available,
MAX_RECLAIM_RETRIES);
available += zone_page_state_snapshot(zone, NR_FREE_PAGES); available += zone_page_state_snapshot(zone, NR_FREE_PAGES);
/* /*
* Would the allocation succeed if we reclaimed the whole * Would the allocation succeed if we reclaimed all
* available? * reclaimable pages?
*/ */
wmark = __zone_watermark_ok(zone, order, min_wmark, wmark = __zone_watermark_ok(zone, order, min_wmark,
ac_classzone_idx(ac), alloc_flags, available); ac_classzone_idx(ac), alloc_flags, available);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment