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

Commit daed5b56 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm: discard free cma pages in boost_eligible calculations"

parents 8e872b6a c10c5d94
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -2232,7 +2232,8 @@ static bool boost_eligible(struct zone *z)
	high_wmark = z->_watermark[WMARK_HIGH];
	reclaim_eligible = zone_page_state_snapshot(z, NR_ZONE_INACTIVE_FILE) +
			zone_page_state_snapshot(z, NR_ZONE_ACTIVE_FILE);
	free_pages = zone_page_state(z, NR_FREE_PAGES);
	free_pages = zone_page_state(z, NR_FREE_PAGES) -
			zone_page_state(z, NR_FREE_CMA_PAGES);
	threshold = high_wmark + (2 * mult_frac(high_wmark,
					watermark_boost_factor, 10000));

@@ -3617,6 +3618,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;