Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3583426ybt; Tue, 23 Jun 2020 06:06:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqvViuo7I/g+7XK/w3U6n9UPeTc8Sg1WudV4lO0IQbRQmpmzeD9e0ZtNE2Gvq4JYCCYgxU X-Received: by 2002:a17:906:7e19:: with SMTP id e25mr19778086ejr.319.1592917586108; Tue, 23 Jun 2020 06:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592917586; cv=none; d=google.com; s=arc-20160816; b=O+ty2HNa5l74uuzg72oe471pvTPrrbIfNP8Jve2KVI3bthi41Ak0Vm7O6xfbfWVJcN 1FE87jmOswJNC/IgJk5rxFtV1NcFDJwONTYnsybLUxu7KqrngItfGKd+TmzGCw2BVqw4 CJgXMefeVlbk5KtsffrH9xomCDha3xJ8lVtiF1M270Ow1WIRtYZ6/7iBvOcQwG4kYjGb +ifdX99dIzDAtwlitwoq5fdpDmAEt/wBVBxryUpoTU2k8S9MEx7M9y6NCzvN5W4lbTvm gETjG1h0xk3vly+DWeyCDi82HF2m/1rwmBL6KzNwiiJwh67xyI5ZTyYoRwlC7jjwb661 jPpA== 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; bh=UMeXj9gEu6mOkGGZVMZPSy0hX5G3SwwQMeJ+x4wb7Fw=; b=z6jDSQYO+083C6gvY5SUIvGdTh1vY45cHSBs0GhLiNsblALCelb9iemp2WZ78qdCGX +GbkeoLkYQgWY8xeaLUsBQ1JVzqkvSeco1qscJc5C9gKmfNqKW/iyZtjrpPo9Y1jqhVF IvAFsDyVJLPEZGjHypNn17RZon8czItYMONg4fKaeacMZ8whjTxo2COYaX+iStPAUVe7 eEClw0if1PKm/MGT9YCC5EKp9Xs8DzKVibKIbC3Rvt/pyauLBK7y3I13AILfGbhWLLqG KuuXTUQQMwEoP4esV7ywXRukL+OD6lckkjuLApKcjoQ6nCLbXKqLxx1qGmbqla+FoXJy z2PQ== ARC-Authentication-Results: i=1; mx.google.com; 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 dp9si14213978ejc.698.2020.06.23.06.06.02; Tue, 23 Jun 2020 06:06:26 -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; 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 S1732643AbgFWNC7 (ORCPT + 99 others); Tue, 23 Jun 2020 09:02:59 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38166 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729504AbgFWNC6 (ORCPT ); Tue, 23 Jun 2020 09:02:58 -0400 Received: by mail-wr1-f67.google.com with SMTP id z13so8676141wrw.5 for ; Tue, 23 Jun 2020 06:02:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UMeXj9gEu6mOkGGZVMZPSy0hX5G3SwwQMeJ+x4wb7Fw=; b=mtYMLEX+ynv+lB2sd5XZCgZBp4YtCerG7KychD1hvSZJe8Q11PYvrpuWFL1loS1FPB 43n3hW7EmwcT4UFacExHW/EuSLhFWZAZWKGLi35siUGMI95D8/Vmm5LNXmFYwUVxTjsa FujQl2T4ttXi2CPk9PkJ5+eGvGPRFtHzKFEBStTDgIKRSnsMO0Hca6jbROz8jvut7UVW R9J6raekmT7xzGJERtGPYMHyvLQY3G+5nqUnGWBddiqlioUQl2KQxiw9WpLyOfSCry5q kJSTsyBnQ0BIyOuGWtsBbXFl7IUTxBLqAZ3u1XDLR5vxyrTf5Y9FLgaJAvW3iAbztGYH BqaQ== X-Gm-Message-State: AOAM530VCHhA+LzSxAURPUc4dczKTatpi/509ZUA/Y+3r3yk57elMdfw PQXCK8bqu2EhCmqgrCnXOBk= X-Received: by 2002:adf:8444:: with SMTP id 62mr24144074wrf.278.1592917376580; Tue, 23 Jun 2020 06:02:56 -0700 (PDT) Received: from localhost (ip-37-188-173-135.eurotel.cz. [37.188.173.135]) by smtp.gmail.com with ESMTPSA id 185sm3722865wmz.22.2020.06.23.06.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 06:02:55 -0700 (PDT) Date: Tue, 23 Jun 2020 15:02:54 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Johannes Weiner , Minchan Kim , Huang Ying , Wei Yang Subject: Re: [PATCH v1 2/2] mm/page_alloc: drop nr_free_pagecache_pages() Message-ID: <20200623130254.GZ31426@dhcp22.suse.cz> 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 19-06-20 15:24:10, 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 nr_free_pagecache_pages was an awkward name which kind of makes sense but it is terribly confusing (e.g. there are pagecache consumers restricted to lowmem zones only). Acked-by: Michal Hocko > --- > 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 -- Michal Hocko SUSE Labs