From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752156AbdCAH4R (ORCPT ); Wed, 1 Mar 2017 02:56:17 -0500 Received: from gum.cmpxchg.org ([85.214.110.215]:37962 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbdCAHzT (ORCPT ); Wed, 1 Mar 2017 02:55:19 -0500 From: Johannes Weiner To: Andrew Morton Cc: Jia He , Michal Hocko , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 2/9] mm: fix check for reclaimable pages in PF_MEMALLOC reclaim throttling Date: Tue, 28 Feb 2017 16:40:00 -0500 Message-Id: <20170228214007.5621-3-hannes@cmpxchg.org> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170228214007.5621-1-hannes@cmpxchg.org> References: <20170228214007.5621-1-hannes@cmpxchg.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") Signed-off-by: Johannes Weiner --- mm/vmscan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 407b27831ff7..f006140f58c6 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2838,8 +2838,10 @@ static bool pfmemalloc_watermark_ok(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); -- 2.11.1