From 2f2da11aecc46c7411105cbb8c1afa636798ac13 Mon Sep 17 00:00:00 2001 From: Charan Teja Reddy Date: Wed, 20 Nov 2019 12:54:27 +0530 Subject: [PATCH] mm: discard free cma pages in boost_eligible calculations Considering the free cma pages in boost_eligible can give wrong results. Subtract them. Change-Id: I5dd3e408bcaf109d51066323686d8d1930093e3b Fixes: 09d35acf52cb ("mm: ignore boosting for min watermark") Signed-off-by: Charan Teja Reddy --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 92b50a496444..47a10f488b66 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2381,7 +2381,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));