Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp496001ybt; Fri, 19 Jun 2020 06:53:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJuLYypotWlUITD1SoEK0VYwGEGoofCjPbS8e5Sy817Rf0kQ46Pn2aNgbRKzu4EeQMp7TN X-Received: by 2002:a17:906:3548:: with SMTP id s8mr3663737eja.202.1592574795802; Fri, 19 Jun 2020 06:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592574795; cv=none; d=google.com; s=arc-20160816; b=xG+cm922AyNVKfYbRI9MpcLENNSzySW5vtJPwYxdrnDW+LKG5b9DNfIMLykdLhslUS rDw3iTur2WM9knmjhTLstECVMiSHqcGaVDpgpv5tlAh01jce8EEWA7ocas2a0xt8Jpou /LWp/8u5WVQcNTTV5Sv7gAKrwelIlj47KoEzIVRqNt8Udnw8BZzW68HSPyEFT73zW4qe R4mPDnRJHTg4BHVSYbHsJT0zbOhUtYwElkqmzT0qvwA+OoI0HiYk4l/A+VWLxDK5a3K+ 7uJ2VPegBKIqqqmp3ITGzXExOjivmu3QJfyjvL15O0oQDKQmmT5ELsTZQe5C0TkiaySw G97A== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=CUtUDEO7uf8o43KeJMaFdOcK00bicL+aAydzipPJiTc=; b=xbOzmfb1i0h6lFMrzaN20OMLb0m+GQBbDrXnxhUqRqpZyZ5l0p+ID98uWL1R8d2N0U keR2IwmMJVzSUB0SWKf3VkSPucnu23R0QcbCDmtMGgPs4OPNtqWnGJ7OVuax6JvPbY+X pPmrdLJ248aZeOb5hk9H35ZCExMiGq6vYwXbB3QQkRCjZDuu99IkAV02B0uXr+tYOCW7 ZKoF51u58VVORkhFTAvyr/nvaZ4/tr0Q+KGIljKbayVIeO/NuAk5yK4xIje1MDSjI7i6 GWATNQr85OZsQPUL00cij4Z6dfaYMXs2jxL5dzEbuiJfPg0AD1oJU17vqiq7nsBllXct Vd4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e60NHLWc; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qp14si3612576ejb.61.2020.06.19.06.52.53; Fri, 19 Jun 2020 06:53:15 -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=@gmail.com header.s=20161025 header.b=e60NHLWc; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732796AbgFSNtE (ORCPT + 99 others); Fri, 19 Jun 2020 09:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731738AbgFSNtC (ORCPT ); Fri, 19 Jun 2020 09:49:02 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9209FC06174E for ; Fri, 19 Jun 2020 06:49:02 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id p20so10217476ejd.13 for ; Fri, 19 Jun 2020 06:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CUtUDEO7uf8o43KeJMaFdOcK00bicL+aAydzipPJiTc=; b=e60NHLWcKqhOgckYZvip4+wgTCow8xCgDxmiX7YmqWMlDkR6vBV1/ANbbt3Tzm+fJO 8u7a2Ml3mC5DqqUx0blDwxN6UbZYcegv5rOFpWtY6/1sH12Q49LqCyaMsx1y7D5PnbLc a4ZegSYFt9YBGouzbDTO0Q3jtyZ+PJJXNej9ulhatCCjMecTY/49oyiJy0xntlncZAFE ET1EqfaRPnouVIVqXtDx85WpXi8Uu9nLKLdZaQa2PKFEQH1PFvGysYn4w9xJFLfY9ob5 fA1NW8nRFndUSfGB/95VYLOC/QDvN6r6s/vLKCVLFz3lxWya3T2yvegtOt5U+hDpA2Rp vKpw== 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:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=CUtUDEO7uf8o43KeJMaFdOcK00bicL+aAydzipPJiTc=; b=Sbp4VaVYJ7IIIp2iE2XZk5xyHrUWiBvx1vEFVw7+hMyJ/TxSqHUTNHLLPx3qj+fRu5 F7+oe/g1Hdircb7GJ1Zl9V0dKuzdwDSEKva0cvqtigAq6sOGbPbrJWxbj7efsNgwlRQD zU8LS/5FKRPHiygUfT9Kwt6ehhweU8gR/DDr8wtynWEmT8n56yigoDDeXgDAwJEwZIvi iNkdbfirnSBOhqHo8Htsq+EtWcMB6mV4D63MRwxsFiLJjLk1oTyC3USOT4H4ijgnX/hj ebwC56cjh0shADQtbTrBWkJYaw6Pt97L+nHaRNTnMAWQApbWY0dFnWk2lSintTE1CEFN w7qw== X-Gm-Message-State: AOAM530MKiZQ493APCSGBNSBJpakC14yX9lQmZjzs5zkDF0j+3WebOJe GIHihE747UAa4M79lNRmMmM= X-Received: by 2002:a17:906:ca54:: with SMTP id jx20mr3724564ejb.549.1592574539717; Fri, 19 Jun 2020 06:48:59 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id s15sm4647901edw.54.2020.06.19.06.48.58 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Jun 2020 06:48:58 -0700 (PDT) Date: Fri, 19 Jun 2020 13:48:58 +0000 From: Wei Yang 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: <20200619134858.hviovr5ysjikdnz7@master> Reply-To: Wei Yang 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> User-Agent: NeoMutt/20170113 (1.7.2) 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. Not sure "inline it" is the proper word for this. > >Cc: Andrew Morton >Cc: Johannes Weiner >Cc: Michal Hocko >Cc: Minchan Kim >Cc: Huang Ying >Cc: Wei Yang >Signed-off-by: David Hildenbrand Besides: Reviewed-by: Wei Yang >--- > 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 -- Wei Yang Help you, Help me