Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp477399ybt; Fri, 19 Jun 2020 06:27:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztDk6FmX1D45sG5k3ABUOb5tOFsEU7wFml/Ub31qANhjBrVyUMzkJn/mB3ntzsd0RgB/Rg X-Received: by 2002:aa7:d698:: with SMTP id d24mr3416448edr.56.1592573259548; Fri, 19 Jun 2020 06:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592573259; cv=none; d=google.com; s=arc-20160816; b=Yx7ZqaAK6r/wvj4NhXp4NQxO6eOdcqwZOIItDJB+EUkViFkejixlEicfuWdqGxm0dH MpeI+UXE464eA4ewXYnaCjO5JOJXjVAb75fnGeiQM5l3NtkEO7XkAs7PmYMvMWUclsj5 gw9xBwDYUREmXlD18+YOVzftt6esOiGY2H41IBa5aQ9jLm/SjuzPRcZUK0PSYHl9ioyT OqVk6hqFDO0/xtUYViP9qiDTPD+2NmjScX9mln9VJq01697idzAAmhoFexlgQDoyoZyp SPGjxHZH2XcZCe7hxi6z/pFIQ/kZSLtIepGowEFEV2ziB9OlPOcyuEkf6lf4qosbW+n7 CGuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eGlNqou5LDoam9OH21SBUp2++cVRlrtERoD4CCiv5eg=; b=o7St44riXTihmrv3oUMacRf88wgS4MVwyuG/5HOKC7yBBQigX/mcx1FwOeXwpewSA0 7Y5fNmZNHIJ1kFmm+bB4ulimInrrJHddqqLNRj87v+Ap24u9fL7Rks7sgdPQbK+5q2Fq uz+fhqAMFJu6PnaKjCUJTjDOtBq0+S9HhIayhdSu2kIBY1dtqDgV8w9Lu91SLh5+lwL0 mJnraSBji8SNTxQ/uwy8JGN4j9tX4y1txUM9vEyhmA/m6j/HtM9j/fo6MugB5OyTPWg4 cqneb4VAcrLbMrB+s8AP2r19Pj3gUuxjvBS4UtmNFBMQrorr59w+D4kxaIJtthcJ/9U2 ORUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZSRxq2t3; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gh7si3856885ejb.81.2020.06.19.06.27.17; Fri, 19 Jun 2020 06:27:39 -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=@redhat.com header.s=mimecast20190719 header.b=ZSRxq2t3; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732757AbgFSNYt (ORCPT + 99 others); Fri, 19 Jun 2020 09:24:49 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:24789 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732644AbgFSNYp (ORCPT ); Fri, 19 Jun 2020 09:24:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592573084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eGlNqou5LDoam9OH21SBUp2++cVRlrtERoD4CCiv5eg=; b=ZSRxq2t3FfWZtlGW034m7BFz7WsrEqsRTH9TOQvsEEvHP/4y0vZKTbWOdj6t5gmwXkugr5 QtkITl+ofpY0f6aalocauzIje/HanSiHu1kB9GgMsWgcDygKkZHuXB7hUbyC0S2054adMc DiKmTktyWc6KwwhW4bUXW8gMY4rI4kU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-73-oAxdefiAP_u9TarLyJnNkA-1; Fri, 19 Jun 2020 09:24:42 -0400 X-MC-Unique: oAxdefiAP_u9TarLyJnNkA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ED09A80F5C6; Fri, 19 Jun 2020 13:24:20 +0000 (UTC) Received: from t480s.redhat.com (ovpn-113-137.ams2.redhat.com [10.36.113.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 150C719D61; Fri, 19 Jun 2020 13:24:18 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Johannes Weiner , Michal Hocko , Minchan Kim , Huang Ying , Wei Yang Subject: [PATCH v1 2/2] mm/page_alloc: drop nr_free_pagecache_pages() Date: Fri, 19 Jun 2020 15:24:10 +0200 Message-Id: <20200619132410.23859-3-david@redhat.com> In-Reply-To: <20200619132410.23859-1-david@redhat.com> References: <20200619132410.23859-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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