Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5323161imu; Tue, 13 Nov 2018 04:56:50 -0800 (PST) X-Google-Smtp-Source: AJdET5fAy5KCbqGoN3OOeD5+25QZ6et7Wpqc+0GGK/kr25qX7EfvufONGXRdEvXPhoAyQjDrsSJN X-Received: by 2002:a17:902:6946:: with SMTP id k6-v6mr5061738plt.270.1542113810399; Tue, 13 Nov 2018 04:56:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542113810; cv=none; d=google.com; s=arc-20160816; b=v0RWkxSp1Suvx8wfONua5ouYPAXBao/m1PY+Ppp/E//KAqf6gRQjog0yvSZgI9Fxju l4//69ktigR8B+GxJiuT9ZpEpUsHV7eEsNdfW2NmDcQbe1IXHW5Kzd4vAEb4QIWmlECr 6kz1pTV53nPp0iA+LDQvak8sYnXLDDoQA5EvBR6Zk6U6KENE/oD98lMzapsJd27T26EX 1hpxwASOYyERdFRw4BPch0ncAdR0pjL3CPOa+Ej1LmWFat2RjDsV8c5E1Lgq5ETfLcTl 1F5YDxZjYaKGma1sGLAITuAFUGD8cnOfPGNrcwYXM3r1N/TUUi7HJD+Y9ZMlhJTuCv/R Ynug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wbO/IeUS2CYzsC217ZBfJdvMrbpPFGdKjNwFYyLM3Nc=; b=hcfkzZYv1ESTsOL8H5wJpHcAK20pfVDcpGBAOs2FoGiDCLPaKszy7JP1eXlfuEZSfE 8y1O2SdDvoat8k8+9cCHUKNO1c6HFOfxCsRazbuc8bArVMcbg1KeBCzCN2wQ9uNY7+Jo MERijlWDX5mSf3hqjuc0YJ1h74BpS8KpmZ9sS75M4ErvZ8CVRohfDQm/SJ5WIL57eLd3 5QqNGbYI8M/p+8NlS3OM/eqiJKFN+QimuhFpOGgWgpZheuK1OriVytHVJBDb2rSrVNxO 6q1p9r/xwBR6W0bJXWHRliINyhHU7uiOi5c0vBGAGqAfLimUdWbcuHf9YnrkHYTgVOXo 2VzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22-v6si20909442plp.371.2018.11.13.04.56.34; Tue, 13 Nov 2018 04:56:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733100AbeKMWyP (ORCPT + 99 others); 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