From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2965C43441 for ; Tue, 13 Nov 2018 12:56:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9339022360 for ; Tue, 13 Nov 2018 12:56:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9339022360 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733137AbeKMWyP (ORCPT ); Tue, 13 Nov 2018 17:54:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:56446 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732728AbeKMWyO (ORCPT ); Tue, 13 Nov 2018 17:54:14 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 43332B089; Tue, 13 Nov 2018 12:56:12 +0000 (UTC) Date: Tue, 13 Nov 2018 13:56:11 +0100 From: Michal Hocko To: Wei Yang Cc: akpm@linux-foundation.org, mgorman@techsingularity.net, willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n Message-ID: <20181113125611.GA16182@dhcp22.suse.cz> References: <20181113041750.20784-1-richard.weiyang@gmail.com> <20181113080436.22078-1-richard.weiyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181113080436.22078-1-richard.weiyang@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 13-11-18 16:04:36, Wei Yang wrote: > Commit fa5e084e43eb ("vmscan: do not unconditionally treat zones that > fail zone_reclaim() as full") changed the return value of node_reclaim(). > The original return value 0 means NODE_RECLAIM_SOME after this commit. > > While the return value of node_reclaim() when CONFIG_NUMA is n is not > changed. This will leads to call zone_watermark_ok() again. > > This patch fix the return value by adjusting to NODE_RECLAIM_NOSCAN. Since > node_reclaim() is only called in page_alloc.c, move it to mm/internal.h. The issue should be cosmetic but the code consistency is definitely an improvement. Moving this from swap.h makes a lot of sense as well. > Signed-off-by: Wei Yang Acked-by: Michal Hocko > --- > v2: move node_reclaim() to mm/internal.h > --- > include/linux/swap.h | 6 ------ > mm/internal.h | 10 ++++++++++ > 2 files changed, 10 insertions(+), 6 deletions(-) > > diff --git a/include/linux/swap.h b/include/linux/swap.h > index d8a07a4f171d..065988c27373 100644 > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -358,14 +358,8 @@ extern unsigned long vm_total_pages; > extern int node_reclaim_mode; > extern int sysctl_min_unmapped_ratio; > extern int sysctl_min_slab_ratio; > -extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int); > #else > #define node_reclaim_mode 0 > -static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask, > - unsigned int order) > -{ > - return 0; > -} > #endif > > extern int page_evictable(struct page *page); > diff --git a/mm/internal.h b/mm/internal.h > index 291eb2b6d1d8..6a57811ae47d 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -444,6 +444,16 @@ static inline void mminit_validate_memmodel_limits(unsigned long *start_pfn, > #define NODE_RECLAIM_SOME 0 > #define NODE_RECLAIM_SUCCESS 1 > > +#ifdef CONFIG_NUMA > +extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int); > +#else > +static inline int node_reclaim(struct pglist_data *pgdat, gfp_t mask, > + unsigned int order) > +{ > + return NODE_RECLAIM_NOSCAN; > +} > +#endif > + > extern int hwpoison_filter(struct page *p); > > extern u32 hwpoison_filter_dev_major; > -- > 2.15.1 -- Michal Hocko SUSE Labs