Skip to content

Commit 56b9413

Browse files
davidhildenbrandtorvalds
authored andcommitted
mm/page_alloc: remove nr_free_pagecache_pages()
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 open-code it instead and add a comment. Signed-off-by: David Hildenbrand <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Wei Yang <[email protected]> Reviewed-by: Pankaj Gupta <[email protected]> Reviewed-by: Mike Rapoport <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Huang Ying <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0a18e60 commit 56b9413

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

include/linux/swap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ void workingset_update_node(struct xa_node *node);
328328
/* linux/mm/page_alloc.c */
329329
extern unsigned long totalreserve_pages;
330330
extern unsigned long nr_free_buffer_pages(void);
331-
extern unsigned long nr_free_pagecache_pages(void);
332331

333332
/* Definition of global_zone_page_state not available yet */
334333
#define nr_free_pages() global_zone_page_state(NR_FREE_PAGES)

mm/page_alloc.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5186,19 +5186,6 @@ unsigned long nr_free_buffer_pages(void)
51865186
}
51875187
EXPORT_SYMBOL_GPL(nr_free_buffer_pages);
51885188

5189-
/**
5190-
* nr_free_pagecache_pages - count number of pages beyond high watermark
5191-
*
5192-
* nr_free_pagecache_pages() counts the number of pages which are beyond the
5193-
* high watermark within all zones.
5194-
*
5195-
* Return: number of pages beyond high watermark within all zones.
5196-
*/
5197-
unsigned long nr_free_pagecache_pages(void)
5198-
{
5199-
return nr_free_zone_pages(gfp_zone(GFP_HIGHUSER_MOVABLE));
5200-
}
5201-
52025189
static inline void show_node(struct zone *zone)
52035190
{
52045191
if (IS_ENABLED(CONFIG_NUMA))
@@ -5920,7 +5907,8 @@ void __ref build_all_zonelists(pg_data_t *pgdat)
59205907
__build_all_zonelists(pgdat);
59215908
/* cpuset refresh routine should be here */
59225909
}
5923-
vm_total_pages = nr_free_pagecache_pages();
5910+
/* Get the number of free pages beyond high watermark in all zones. */
5911+
vm_total_pages = nr_free_zone_pages(gfp_zone(GFP_HIGHUSER_MOVABLE));
59245912
/*
59255913
* Disable grouping by mobility if the number of pages in the
59265914
* system is too low to allow the mechanism to work. It would be

0 commit comments

Comments
 (0)