Skip to content

Commit 0a18e60

Browse files
davidhildenbrandtorvalds
authored andcommitted
mm: remove vm_total_pages
The global variable "vm_total_pages" is a relic from older days. There is only a single user that reads the variable - build_all_zonelists() - and the first thing it does is update it. Use a local variable in build_all_zonelists() instead and remove the global variable. 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: Huang Ying <[email protected]> Cc: Minchan Kim <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent f80b08f commit 0a18e60

File tree

5 files changed

+4
-13
lines changed

5 files changed

+4
-13
lines changed

include/linux/swap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ extern unsigned long mem_cgroup_shrink_node(struct mem_cgroup *mem,
372372
extern unsigned long shrink_all_memory(unsigned long nr_pages);
373373
extern int vm_swappiness;
374374
extern int remove_mapping(struct address_space *mapping, struct page *page);
375-
extern unsigned long vm_total_pages;
376375

377376
extern unsigned long reclaim_pages(struct list_head *page_list);
378377
#ifdef CONFIG_NUMA

mm/memory_hotplug.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages,
844844
kswapd_run(nid);
845845
kcompactd_run(nid);
846846

847-
vm_total_pages = nr_free_pagecache_pages();
848-
849847
writeback_set_ratelimit();
850848

851849
memory_notify(MEM_ONLINE, &arg);
@@ -1595,7 +1593,6 @@ static int __ref __offline_pages(unsigned long start_pfn,
15951593
kcompactd_stop(node);
15961594
}
15971595

1598-
vm_total_pages = nr_free_pagecache_pages();
15991596
writeback_set_ratelimit();
16001597

16011598
memory_notify(MEM_OFFLINE, &arg);

mm/page-writeback.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,13 +2076,11 @@ static int page_writeback_cpu_online(unsigned int cpu)
20762076
* Called early on to tune the page writeback dirty limits.
20772077
*
20782078
* We used to scale dirty pages according to how total memory
2079-
* related to pages that could be allocated for buffers (by
2080-
* comparing nr_free_buffer_pages() to vm_total_pages.
2079+
* related to pages that could be allocated for buffers.
20812080
*
20822081
* However, that was when we used "dirty_ratio" to scale with
20832082
* all memory, and we don't do that any more. "dirty_ratio"
2084-
* is now applied to total non-HIGHPAGE memory (by subtracting
2085-
* totalhigh_pages from vm_total_pages), and as such we can't
2083+
* is now applied to total non-HIGHPAGE memory, and as such we can't
20862084
* get into the old insane situation any more where we had
20872085
* large amounts of dirty pages compared to a small amount of
20882086
* non-HIGHMEM memory.

mm/page_alloc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5912,6 +5912,8 @@ build_all_zonelists_init(void)
59125912
*/
59135913
void __ref build_all_zonelists(pg_data_t *pgdat)
59145914
{
5915+
unsigned long vm_total_pages;
5916+
59155917
if (system_state == SYSTEM_BOOTING) {
59165918
build_all_zonelists_init();
59175919
} else {

mm/vmscan.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,6 @@ struct scan_control {
170170
* From 0 .. 200. Higher means more swappy.
171171
*/
172172
int vm_swappiness = 60;
173-
/*
174-
* The total number of pages which are beyond the high watermark within all
175-
* zones.
176-
*/
177-
unsigned long vm_total_pages;
178173

179174
static void set_task_reclaim_state(struct task_struct *task,
180175
struct reclaim_state *rs)

0 commit comments

Comments
 (0)