mm: ignore boosting for min watermark

Ignore boosting for min watermark for __GFP_ATOMIC, ALLOC_HIGH and
ALLOC_HARDER allocation requests. Of the others, this helps in avoiding
the atomic allocation failures.

Change-Id: I41dcc71ed37b7a1d2093d13f40e82c7750642e39
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
This commit is contained in:
Charan Teja Reddy 2019-11-14 11:57:11 +05:30 • committed by Isaac J. Manjarres
commit 05ebc8f08c

View file

@ -3770,6 +3770,20 @@ retry:
}
mark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK);
/*
* Allow high, atomic, harder order-0 allocation requests
* to skip the ->watermark_boost for min watermark check.
* In doing so, check for:
* 1) ALLOC_WMARK_MIN - Allow to wake up kswapd in the
* slow path.
* 2) ALLOC_HIGH - Allow high priority requests.
* 3) ALLOC_HARDER - Allow (__GFP_ATOMIC && !__GFP_NOMEMALLOC),
* of the others.
*/
if (unlikely(!order && (alloc_flags & ALLOC_WMARK_MIN) &&
(alloc_flags & (ALLOC_HARDER | ALLOC_HIGH)))) {
mark = zone->_watermark[WMARK_MIN];
}
if (!zone_watermark_fast(zone, order, mark,
ac_classzone_idx(ac), alloc_flags)) {
int ret;