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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 204A9C433E0 for ; Sun, 21 Jun 2020 14:47:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D7D9E251DD for ; Sun, 21 Jun 2020 14:47:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="TaZdrotI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7D9E251DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 887378D0022; Sun, 21 Jun 2020 10:47:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85EF38D001E; Sun, 21 Jun 2020 10:47:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 79ADB8D0022; Sun, 21 Jun 2020 10:47:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 5F5DD8D001E for ; Sun, 21 Jun 2020 10:47:39 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 18A7D181AC9CB for ; Sun, 21 Jun 2020 14:47:39 +0000 (UTC) X-FDA: 76953497838.12.back63_420a35026e2b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id E6532180070E2 for ; Sun, 21 Jun 2020 14:47:38 +0000 (UTC) X-HE-Tag: back63_420a35026e2b X-Filterd-Recvd-Size: 4285 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Sun, 21 Jun 2020 14:47:38 +0000 (UTC) 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> X-Rspamd-Queue-Id: E6532180070E2 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.