Commit ea160218 authored by Andrea Arcangeli's avatar Andrea Arcangeli

mm: zone_reclaim: after a successful zone_reclaim check the min watermark

If we're in the fast path and we succeeded zone_reclaim(), it means we
freed enough memory and we can use the min watermark to have some
margin against concurrent allocations from other CPUs or interrupts.
parent b6c2abee
......@@ -2220,8 +2220,26 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
case ZONE_RECLAIM_FULL:
/* scanned but unreclaimable */
continue;
case ZONE_RECLAIM_SUCCESS:
/*
* If we successfully reclaimed
* enough, allow allocations up to the
* min watermark (instead of stopping
* at "mark"). This provides some more
* margin against parallel
* allocations. Using the min
* watermark doesn't alter when we
* wakeup kswapd. It also doesn't
* alter the synchronous direct
* reclaim behavior of zone_reclaim()
* that will still be invoked at the
* next pass if we're still below the
* low watermark (even if kswapd isn't
* woken).
*/
mark = min_wmark_pages(zone);
/* Fall through */
default:
/* did we reclaim enough */
if (zone_watermark_ok(zone, order, mark,
ac->classzone_idx, alloc_flags))
goto try_this_zone;
......
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