Commit 0a18e607 authored by David Hildenbrand's avatar David Hildenbrand Committed by Linus Torvalds

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: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarWei Yang <richard.weiyang@gmail.com>
Reviewed-by: default avatarPankaj Gupta <pankaj.gupta.linux@gmail.com>
Reviewed-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Minchan Kim <minchan@kernel.org>
Link: http://lkml.kernel.org/r/20200619132410.23859-2-david@redhat.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f80b08fc
...@@ -372,7 +372,6 @@ extern unsigned long mem_cgroup_shrink_node(struct mem_cgroup *mem, ...@@ -372,7 +372,6 @@ extern unsigned long mem_cgroup_shrink_node(struct mem_cgroup *mem,
extern unsigned long shrink_all_memory(unsigned long nr_pages); extern unsigned long shrink_all_memory(unsigned long nr_pages);
extern int vm_swappiness; extern int vm_swappiness;
extern int remove_mapping(struct address_space *mapping, struct page *page); extern int remove_mapping(struct address_space *mapping, struct page *page);
extern unsigned long vm_total_pages;
extern unsigned long reclaim_pages(struct list_head *page_list); extern unsigned long reclaim_pages(struct list_head *page_list);
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
......
...@@ -844,8 +844,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, ...@@ -844,8 +844,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages,
kswapd_run(nid); kswapd_run(nid);
kcompactd_run(nid); kcompactd_run(nid);
vm_total_pages = nr_free_pagecache_pages();
writeback_set_ratelimit(); writeback_set_ratelimit();
memory_notify(MEM_ONLINE, &arg); memory_notify(MEM_ONLINE, &arg);
...@@ -1595,7 +1593,6 @@ static int __ref __offline_pages(unsigned long start_pfn, ...@@ -1595,7 +1593,6 @@ static int __ref __offline_pages(unsigned long start_pfn,
kcompactd_stop(node); kcompactd_stop(node);
} }
vm_total_pages = nr_free_pagecache_pages();
writeback_set_ratelimit(); writeback_set_ratelimit();
memory_notify(MEM_OFFLINE, &arg); memory_notify(MEM_OFFLINE, &arg);
......
...@@ -2076,13 +2076,11 @@ static int page_writeback_cpu_online(unsigned int cpu) ...@@ -2076,13 +2076,11 @@ static int page_writeback_cpu_online(unsigned int cpu)
* Called early on to tune the page writeback dirty limits. * Called early on to tune the page writeback dirty limits.
* *
* We used to scale dirty pages according to how total memory * We used to scale dirty pages according to how total memory
* related to pages that could be allocated for buffers (by * related to pages that could be allocated for buffers.
* comparing nr_free_buffer_pages() to vm_total_pages.
* *
* However, that was when we used "dirty_ratio" to scale with * However, that was when we used "dirty_ratio" to scale with
* all memory, and we don't do that any more. "dirty_ratio" * all memory, and we don't do that any more. "dirty_ratio"
* is now applied to total non-HIGHPAGE memory (by subtracting * is now applied to total non-HIGHPAGE memory, and as such we can't
* totalhigh_pages from vm_total_pages), and as such we can't
* get into the old insane situation any more where we had * get into the old insane situation any more where we had
* large amounts of dirty pages compared to a small amount of * large amounts of dirty pages compared to a small amount of
* non-HIGHMEM memory. * non-HIGHMEM memory.
......
...@@ -5912,6 +5912,8 @@ build_all_zonelists_init(void) ...@@ -5912,6 +5912,8 @@ build_all_zonelists_init(void)
*/ */
void __ref build_all_zonelists(pg_data_t *pgdat) void __ref build_all_zonelists(pg_data_t *pgdat)
{ {
unsigned long vm_total_pages;
if (system_state == SYSTEM_BOOTING) { if (system_state == SYSTEM_BOOTING) {
build_all_zonelists_init(); build_all_zonelists_init();
} else { } else {
......
...@@ -170,11 +170,6 @@ struct scan_control { ...@@ -170,11 +170,6 @@ struct scan_control {
* From 0 .. 200. Higher means more swappy. * From 0 .. 200. Higher means more swappy.
*/ */
int vm_swappiness = 60; int vm_swappiness = 60;
/*
* The total number of pages which are beyond the high watermark within all
* zones.
*/
unsigned long vm_total_pages;
static void set_task_reclaim_state(struct task_struct *task, static void set_task_reclaim_state(struct task_struct *task,
struct reclaim_state *rs) struct reclaim_state *rs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment