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 <charante@codeaurora.org>
This commit is contained in:
Charan Teja Reddy 2019-11-20 12:54:27 +05:30 committed by Gerrit - the friendly Code Review server
parent 6b274863bc
commit c10c5d94f5

View file

@ -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));