From: Johannes Weiner Date: Wed, 3 May 2017 21:51:54 +0000 (-0700) Subject: mm: fix check for reclaimable pages in PF_MEMALLOC reclaim throttling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d450abd81b081d45adb12f303a07dd44b15eb1bc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mm: fix check for reclaimable pages in PF_MEMALLOC reclaim throttling PF_MEMALLOC direct reclaimers get throttled on a node when the sum of all free pages in each zone fall below half the min watermark. During the summation, we want to exclude zones that don't have reclaimables. Checking the same pgdat over and over again doesn't make sense. Fixes: 599d0c954f91 ("mm, vmscan: move LRU lists to node") Link: http://lkml.kernel.org/r/20170228214007.5621-3-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Hillf Danton Acked-by: Michal Hocko Cc: Jia He Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 667644e53b5c..52832bedb2ed 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2835,8 +2835,10 @@ static bool allow_direct_reclaim(pg_data_t *pgdat) for (i = 0; i <= ZONE_NORMAL; i++) { zone = &pgdat->node_zones[i]; - if (!managed_zone(zone) || - pgdat_reclaimable_pages(pgdat) == 0) + if (!managed_zone(zone)) + continue; + + if (!zone_reclaimable_pages(zone)) continue; pfmemalloc_reserve += min_wmark_pages(zone);