diff options
author | Michal Hocko <mhocko@suse.com> | 2017-09-06 19:23:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-06 20:27:29 -0400 |
commit | c41f012ade0b95b0a6e25c7150673e0554736165 (patch) | |
tree | c3270264283dff1de402a6609b155c804c097320 /fs/proc | |
parent | 4da243ac1cf6aeb30b7c555d56208982d66d6d33 (diff) |
mm: rename global_page_state to global_zone_page_state
global_page_state is error prone as a recent bug report pointed out [1].
It only returns proper values for zone based counters as the enum it
gets suggests. We already have global_node_page_state so let's rename
global_page_state to global_zone_page_state to be more explicit here.
All existing users seems to be correct:
$ git grep "global_page_state(NR_" | sed 's@.*(\(NR_[A-Z_]*\)).*@\1@' | sort | uniq -c
2 NR_BOUNCE
2 NR_FREE_CMA_PAGES
11 NR_FREE_PAGES
1 NR_KERNEL_STACK_KB
1 NR_MLOCK
2 NR_PAGETABLE
This patch shouldn't introduce any functional change.
[1] http://lkml.kernel.org/r/201707260628.v6Q6SmaS030814@www262.sakura.ne.jp
Link: http://lkml.kernel.org/r/20170801134256.5400-2-hannes@cmpxchg.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/meminfo.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c index 509a61668d90..cdd979724c74 100644 --- a/fs/proc/meminfo.c +++ b/fs/proc/meminfo.c | |||
@@ -80,7 +80,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) | |||
80 | show_val_kb(m, "Active(file): ", pages[LRU_ACTIVE_FILE]); | 80 | show_val_kb(m, "Active(file): ", pages[LRU_ACTIVE_FILE]); |
81 | show_val_kb(m, "Inactive(file): ", pages[LRU_INACTIVE_FILE]); | 81 | show_val_kb(m, "Inactive(file): ", pages[LRU_INACTIVE_FILE]); |
82 | show_val_kb(m, "Unevictable: ", pages[LRU_UNEVICTABLE]); | 82 | show_val_kb(m, "Unevictable: ", pages[LRU_UNEVICTABLE]); |
83 | show_val_kb(m, "Mlocked: ", global_page_state(NR_MLOCK)); | 83 | show_val_kb(m, "Mlocked: ", global_zone_page_state(NR_MLOCK)); |
84 | 84 | ||
85 | #ifdef CONFIG_HIGHMEM | 85 | #ifdef CONFIG_HIGHMEM |
86 | show_val_kb(m, "HighTotal: ", i.totalhigh); | 86 | show_val_kb(m, "HighTotal: ", i.totalhigh); |
@@ -114,9 +114,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v) | |||
114 | show_val_kb(m, "SUnreclaim: ", | 114 | show_val_kb(m, "SUnreclaim: ", |
115 | global_node_page_state(NR_SLAB_UNRECLAIMABLE)); | 115 | global_node_page_state(NR_SLAB_UNRECLAIMABLE)); |
116 | seq_printf(m, "KernelStack: %8lu kB\n", | 116 | seq_printf(m, "KernelStack: %8lu kB\n", |
117 | global_page_state(NR_KERNEL_STACK_KB)); | 117 | global_zone_page_state(NR_KERNEL_STACK_KB)); |
118 | show_val_kb(m, "PageTables: ", | 118 | show_val_kb(m, "PageTables: ", |
119 | global_page_state(NR_PAGETABLE)); | 119 | global_zone_page_state(NR_PAGETABLE)); |
120 | #ifdef CONFIG_QUICKLIST | 120 | #ifdef CONFIG_QUICKLIST |
121 | show_val_kb(m, "Quicklists: ", quicklist_total_size()); | 121 | show_val_kb(m, "Quicklists: ", quicklist_total_size()); |
122 | #endif | 122 | #endif |
@@ -124,7 +124,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) | |||
124 | show_val_kb(m, "NFS_Unstable: ", | 124 | show_val_kb(m, "NFS_Unstable: ", |
125 | global_node_page_state(NR_UNSTABLE_NFS)); | 125 | global_node_page_state(NR_UNSTABLE_NFS)); |
126 | show_val_kb(m, "Bounce: ", | 126 | show_val_kb(m, "Bounce: ", |
127 | global_page_state(NR_BOUNCE)); | 127 | global_zone_page_state(NR_BOUNCE)); |
128 | show_val_kb(m, "WritebackTmp: ", | 128 | show_val_kb(m, "WritebackTmp: ", |
129 | global_node_page_state(NR_WRITEBACK_TEMP)); | 129 | global_node_page_state(NR_WRITEBACK_TEMP)); |
130 | show_val_kb(m, "CommitLimit: ", vm_commit_limit()); | 130 | show_val_kb(m, "CommitLimit: ", vm_commit_limit()); |
@@ -151,7 +151,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) | |||
151 | #ifdef CONFIG_CMA | 151 | #ifdef CONFIG_CMA |
152 | show_val_kb(m, "CmaTotal: ", totalcma_pages); | 152 | show_val_kb(m, "CmaTotal: ", totalcma_pages); |
153 | show_val_kb(m, "CmaFree: ", | 153 | show_val_kb(m, "CmaFree: ", |
154 | global_page_state(NR_FREE_CMA_PAGES)); | 154 | global_zone_page_state(NR_FREE_CMA_PAGES)); |
155 | #endif | 155 | #endif |
156 | 156 | ||
157 | hugetlb_report_meminfo(m); | 157 | hugetlb_report_meminfo(m); |