linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Minchan Kim <minchan@kernel.org>,
	Huang Ying <ying.huang@intel.com>,
	Wei Yang <richard.weiyang@gmail.com>
Subject: Re: [PATCH v1 2/2] mm/page_alloc: drop nr_free_pagecache_pages()
Date: Tue, 23 Jun 2020 15:02:54 +0200	[thread overview]
Message-ID: <20200623130254.GZ31426@dhcp22.suse.cz> (raw)
In-Reply-To: <20200619132410.23859-3-david@redhat.com>

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 <akpm@linux-foundation.org>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Huang Ying <ying.huang@intel.com>
> Cc: Wei Yang <richard.weiyang@gmail.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>

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 <mhocko@suse.com>

> ---
>  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


      parent reply	other threads:[~2020-06-23 13:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-19 13:24 [PATCH v1 0/2] mm: vm_total_pages and build_all_zonelists() cleanup David Hildenbrand
2020-06-19 13:24 ` [PATCH v1 1/2] mm: drop vm_total_pages David Hildenbrand
2020-06-19 13:47   ` Wei Yang
2020-06-21 14:46   ` Mike Rapoport
2020-06-22  7:03     ` David Hildenbrand
2020-06-21 19:56   ` Pankaj Gupta
2020-06-23 12:59   ` Michal Hocko
2020-06-19 13:24 ` [PATCH v1 2/2] mm/page_alloc: drop nr_free_pagecache_pages() David Hildenbrand
2020-06-19 13:48   ` Wei Yang
2020-06-21 14:47   ` Mike Rapoport
2020-06-21 19:57   ` Pankaj Gupta
2020-06-23 13:02   ` Michal Hocko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200623130254.GZ31426@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=richard.weiyang@gmail.com \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).