Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b274863 authored by Charan Teja Reddy's avatar Charan Teja Reddy Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent eb45ec3a
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3617,6 +3617,20 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
		}

		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;