Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2223203ybt; Sun, 21 Jun 2020 13:00:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0Cvll4jPblDOaC5+1s5gM3mnBEUXyHFpYT12FYeRVl0nNoI4zvk7XMNGqP5UxXQsRYjGV X-Received: by 2002:a17:907:441c:: with SMTP id om20mr12307232ejb.62.1592769641409; Sun, 21 Jun 2020 13:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592769641; cv=none; d=google.com; s=arc-20160816; b=RT2tgcjbyIT2hw4yQJDTViRZ9CAFTad4yFMVwrTo1S+02GdGcLjlnzbVX9KwLrBYzg X8pcfV6ow649radhsG4Lx+nFUbD0G9WcoMWJ3Gj0r1K9LaU3ykvxehV77UP0Cy7aDzFm q9sg1aBydqR8of+MWaOqSey/eQOS0nrkMX0nC5ktH9L+iA211hneAfJaQ3AiXYu5etI9 80Kh3bjDWuiP8ZeDc7KAxSuZT6DRaXaGp4DJHaK38Qo9klW2i7vluuHGuur9TT9ALze+ v2R7AfrS1ZSZhgdzyLtLSTxRRi4bJ5x+DoNPD/ofzG9shRdc19+xp3YcQQ8LBx5GBXiy YCug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xVtO0mf5+18xL2wyRUh4C8eKDbifEpFUpjq+V/g/lJQ=; b=WJtL/OufUt9b9uVcOoLcD8LRQ0vDvMFwBtzEbWwKrnnAUooxhP3rvOGboXTP/OtDcn D+Wm6dDwKhhE+giJ1uIEAM3aHCYzshf8YugyBApIPUSSdUb2xv+Y0P0pVv4/tuaswDo6 0JWaToi2atRp2tdDqjd5l9gw4i0PjH8bKyq/vVE/Ud3R8iiM1wZnBbsQEyVTdRcJnueL 9gbXfbRG+exGO2GQyq622drTNpsoprTXvf3dOUtoRRsGSx2ySEhS4Jf/TBM+T21x8Lhw SZPO9SbXpSaVhp6gnoi3c/CI9JkbkGHPmD/nMs6jq7K4Iz+8NaibXGYctaY5QzhXmZ0t keKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WL8ZpLFi; 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 a22si7566923ejr.529.2020.06.21.13.00.17; Sun, 21 Jun 2020 13:00:41 -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=WL8ZpLFi; 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 S1730595AbgFUT5w (ORCPT + 99 others); Sun, 21 Jun 2020 15:57:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730288AbgFUT5w (ORCPT ); Sun, 21 Jun 2020 15:57:52 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0329AC061794 for ; Sun, 21 Jun 2020 12:57:51 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id o11so6898240wrv.9 for ; Sun, 21 Jun 2020 12:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xVtO0mf5+18xL2wyRUh4C8eKDbifEpFUpjq+V/g/lJQ=; b=WL8ZpLFio6q8DFXdiT+zwbQD5AaPUNF0d+V8V4EXXgRu9kOUgdjhUqKXOLfdnVqM5v 6Z+Vguv3+SGBgKiQkGsxcYhWNzGBiPhm1iZlLsJv4ycKR4DMbATJ8OI/LNsZzn3RqMtX AndVH1BJHsu9Ej6bUXi423R2qOOA639VAXzUAQ36ZOHAQihALUuqNR9SWl3A8omsU63w t+8lEhoMcPsQWXlPWZ4LXtt+7vJOgTbYq6TRhDeSx1b2uX0Z7K6Phk8I4GftIme3wCHg O/g+cnQNqYmAry/H0r9ZzR3kQx6d8XQ1SebUXBb3mE6UUVclOghiVXrAVQ+C/pKbwzhX Z5QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xVtO0mf5+18xL2wyRUh4C8eKDbifEpFUpjq+V/g/lJQ=; b=RVbxcrpy+mAMMa1TskfXwXPwyQ6EdS1IxxP8rxtwyVTQdnsWJCuSDU+Gk3lZw/B4Av NBAhTdk6WxOKHCUluZMR9KEm4NMlXCbyML4Y0jdQPrvAE5DrL/ALf3kECU0T7PduMQea rHxRh04tqD42hfhqmqNeX4yFoBzY7bTXPO0PoCmjEdewmfUr28Ph2jXzNhk4ULj5Iup1 tjq20gdMey4hGdH0kPETDFRNAC5ppfgFfW3A+fHEaBDAtJrh5vi7WGAXmsAdQndM1nkv cKnerTL1iH5TbWuLoBy2/BUgmGkkcliAAbFZd59fFcEFAlBp4FrcFMBLzQC3euwnFEZT 1psA== X-Gm-Message-State: AOAM531USSSvQNcJMyRxcbh/sBhdepk6j5DxeNLaKcBRzwtsBhwP7ikJ qG7rg5w01zsGrwjLpuQeUgHUTQRgcIBuciZzO5U= X-Received: by 2002:adf:93e3:: with SMTP id 90mr15331654wrp.298.1592769469774; Sun, 21 Jun 2020 12:57:49 -0700 (PDT) MIME-Version: 1.0 References: <20200619132410.23859-1-david@redhat.com> <20200619132410.23859-3-david@redhat.com> In-Reply-To: <20200619132410.23859-3-david@redhat.com> From: Pankaj Gupta Date: Sun, 21 Jun 2020 21:57:38 +0200 Message-ID: Subject: Re: [PATCH v1 2/2] mm/page_alloc: drop nr_free_pagecache_pages() To: David Hildenbrand Cc: LKML , Linux MM , Andrew Morton , Johannes Weiner , Michal Hocko , Minchan Kim , Huang Ying , Wei Yang Content-Type: text/plain; charset="UTF-8" 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 Reviewed-by: Pankaj Gupta