From 7bfe15021d898d9dbaf5a260b39ac433cdaf8978 Mon Sep 17 00:00:00 2001 From: UtsavBalar1231 Date: Tue, 26 Apr 2022 21:07:48 +0530 Subject: [PATCH] Revert "mm: ignore the boosting of watermark under lowmemory" This reverts commit feeb6c80da606ffc2eb73ca2e97b563cb4e3b4b1. Signed-off-by: UtsavBalar1231 --- mm/page_alloc.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2c9c4167852a..3c5596da19e8 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2295,37 +2295,11 @@ static bool can_steal_fallback(unsigned int order, int start_mt) return false; } -static bool boost_eligible(struct zone *z) -{ - unsigned long high_wmark, threshold; - unsigned long reclaim_eligible, free_pages; - - 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); - threshold = high_wmark + (2 * mult_frac(high_wmark, - watermark_boost_factor, 10000)); - - /* - * Don't boost watermark If we are already low on memory where the - * boosting can simply put the watermarks at higher levels for a - * longer duration of time and thus the other users relied on the - * watermarks are forced to choose unintended decissions. If memory - * is so low, kswapd in normal mode should help. - */ - - if (reclaim_eligible < threshold && free_pages < threshold) - return false; - - return true; -} - static inline void boost_watermark(struct zone *zone) { unsigned long max_boost; - if (!watermark_boost_factor || !boost_eligible(zone)) + if (!watermark_boost_factor) return; max_boost = mult_frac(zone->_watermark[WMARK_HIGH],