From: Mel Gorman Date: Thu, 13 Jan 2011 23:46:24 +0000 (-0800) Subject: mm: kswapd: treat zone->all_unreclaimable in sleeping_prematurely similar to balance_... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=355b09c47a0cbb73b3e65a57c03f157f2e7ddb0b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mm: kswapd: treat zone->all_unreclaimable in sleeping_prematurely similar to balance_pgdat() After DEF_PRIORITY, balance_pgdat() considers all_unreclaimable zones to be balanced but sleeping_prematurely does not. This can force kswapd to stay awake longer than it should. This patch fixes it. Signed-off-by: Mel Gorman Reviewed-by: Eric B Munson Cc: Minchan Kim Cc: KAMEZAWA Hiroyuki Cc: Simon Kirby Cc: KOSAKI Motohiro Cc: Shaohua Li Cc: Dave Hansen Cc: Johannes Weiner Cc: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index dafb9d91b604..388a0447b8e8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2244,8 +2244,16 @@ static bool sleeping_prematurely(pg_data_t *pgdat, int order, long remaining) if (!populated_zone(zone)) continue; - if (zone->all_unreclaimable) + /* + * balance_pgdat() skips over all_unreclaimable after + * DEF_PRIORITY. Effectively, it considers them balanced so + * they must be considered balanced here as well if kswapd + * is to sleep + */ + if (zone->all_unreclaimable) { + balanced += zone->present_pages; continue; + } if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone), 0, 0))