Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2055786ybt; Sun, 21 Jun 2020 07:50:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydwGAMumVR0GaHSrBpP1SrJCuXkCi2bUGxovwjgeHQrIVf49C/h7xiW0Eq3IzsWebvWVtv X-Received: by 2002:a17:906:fa86:: with SMTP id lt6mr12605658ejb.148.1592751042673; Sun, 21 Jun 2020 07:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592751042; cv=none; d=google.com; s=arc-20160816; b=nwuxAXMmf+DX7svYN93PGa+xGlOxLGB8ywP8+ZRRl7Uvnze86tpS3Pbc7A145qjPM5 BqGTqmL2WaOwi1yQoD4Tm3wkCQex5fZn3Quz6b3a9720hvi7F1m6g+JSq6DKVZm0vc6D jPsQw32J7O3zwBt9bLlU2Gg3PLq1OD1BQMAL5aXgNFWrUFF0vrWbauXj8YK03tp19qKB 9n7Lj9jbwjpsfp2X8aYM7CgMTJ+d7zToNqyy62c8Al7VuMTc5F1bR+zzL18kwu0I9UQq JjM/zeZxEQPWK0KonZjShtwKovG/z2jPE9IDscneVM97aqjRvmEQg1qupdYDAtdKCXUp nDmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=W/zUMvUKZ36mHlw/8gFpymEpBoknj7SgGJaqoFzVQsg=; b=c7D2cXyDYeLb3JD7MRQXZvMSOeYBOxziQii7Y9MHrH1GsdjPU7O3UIAMjzBHi02grZ muRakCNfkU+Ul7YPBY0qr61wMFQcKj0HIWJDXSIhQ11BAydfLUSvpdmZgQDkD1pkMXnn i6E+IKh4KbwMKROB/ikUAx9MpR1FmIK86Eh9F12Esk3GswraJk4euweFAHBC1YYm+aKz wATncQzKkxOEm+QQ/tDJVI55fnoehctt+KSdA70dcs0yjqwInfPJxyp/rV4dtvf6fBer nMO5g9ogRUPstq1P+OUtHsZO+Kp+FKQbKnS2d1Die8BgAsyjJES6Kw/1AMcKtdNg1Tvs Tp9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TaZdrotI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du12si10379319ejc.441.2020.06.21.07.50.19; Sun, 21 Jun 2020 07:50:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TaZdrotI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730248AbgFUOri (ORCPT + 99 others); Sun, 21 Jun 2020 10:47:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:38788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730154AbgFUOri (ORCPT ); Sun, 21 Jun 2020 10:47:38 -0400 Received: from kernel.org (unknown [87.70.7.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3CA502486F; Sun, 21 Jun 2020 14:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592750857; bh=S87e6iw2gADE5fF4P/mYpr9WJ1jguflXVfGbua8uZcc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TaZdrotIJetYwWuE9R2OQijL0u6N39Jmg2CkdrdtS/HAoygzCuS31Rw3h6qeMbUZy jYck7qtdNwRiq7MBIwzgplfcr3jjjjEIfR3Ott8qR0QdkyYucy1eSDtMSjnbrbqpyf fl0hu8imq/dcooRx8AcoLVMoUvFi2AqsNVUMULT4= Date: Sun, 21 Jun 2020 17:47:28 +0300 From: Mike Rapoport To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Johannes Weiner , Michal Hocko , Minchan Kim , Huang Ying , Wei Yang Subject: Re: [PATCH v1 2/2] mm/page_alloc: drop nr_free_pagecache_pages() Message-ID: <20200621144728.GG6571@kernel.org> References: <20200619132410.23859-1-david@redhat.com> <20200619132410.23859-3-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200619132410.23859-3-david@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 19, 2020 at 03:24:10PM +0200, David Hildenbrand wrote: > nr_free_pagecache_pages() isn't used outside page_alloc.c anymore - and > the name does not really help to understand what's going on. Let's inline > it instead and add a comment. > > Cc: Andrew Morton > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Minchan Kim > Cc: Huang Ying > Cc: Wei Yang > Signed-off-by: David Hildenbrand Reviewed-by: Mike Rapoport > --- > include/linux/swap.h | 1 - > mm/page_alloc.c | 16 ++-------------- > 2 files changed, 2 insertions(+), 15 deletions(-) > > diff --git a/include/linux/swap.h b/include/linux/swap.h > index 124261acd5d0a..9bde6c6b2c045 100644 > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -327,7 +327,6 @@ void workingset_update_node(struct xa_node *node); > /* linux/mm/page_alloc.c */ > extern unsigned long totalreserve_pages; > extern unsigned long nr_free_buffer_pages(void); > -extern unsigned long nr_free_pagecache_pages(void); > > /* Definition of global_zone_page_state not available yet */ > #define nr_free_pages() global_zone_page_state(NR_FREE_PAGES) > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 7b0dde69748c1..c38903d1b3b4d 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5177,19 +5177,6 @@ unsigned long nr_free_buffer_pages(void) > } > EXPORT_SYMBOL_GPL(nr_free_buffer_pages); > > -/** > - * nr_free_pagecache_pages - count number of pages beyond high watermark > - * > - * nr_free_pagecache_pages() counts the number of pages which are beyond the > - * high watermark within all zones. > - * > - * Return: number of pages beyond high watermark within all zones. > - */ > -unsigned long nr_free_pagecache_pages(void) > -{ > - return nr_free_zone_pages(gfp_zone(GFP_HIGHUSER_MOVABLE)); > -} > - > static inline void show_node(struct zone *zone) > { > if (IS_ENABLED(CONFIG_NUMA)) > @@ -5911,7 +5898,8 @@ void __ref build_all_zonelists(pg_data_t *pgdat) > __build_all_zonelists(pgdat); > /* cpuset refresh routine should be here */ > } > - vm_total_pages = nr_free_pagecache_pages(); > + /* Get the number of free pages beyond high watermark in all zones. */ > + vm_total_pages = nr_free_zone_pages(gfp_zone(GFP_HIGHUSER_MOVABLE)); > /* > * Disable grouping by mobility if the number of pages in the > * system is too low to allow the mechanism to work. It would be > -- > 2.26.2 > > -- Sincerely yours, Mike.