diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2017-05-03 14:51:54 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-24 11:00:21 +0100 |
commit | 7eb0b7339722ec570a47503f0d7b14d9c14b8d86 (patch) | |
tree | 45e346786587d119b88dbdf0c5d1224fe9df9d40 /mm | |
parent | 31da33dd8ed44ec5c5d72630644c06905c2be7c5 (diff) |
mm: fix check for reclaimable pages in PF_MEMALLOC reclaim throttling
[ Upstream commit d450abd81b081d45adb12f303a07dd44b15eb1bc ]
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 <hannes@cmpxchg.org>
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Jia He <hejianet@gmail.com>
Cc: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmscan.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 4365de74bdb0..cdd5c3b5c357 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2841,8 +2841,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); |