aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/proc_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/proc_misc.c')
-rw-r--r--fs/proc/proc_misc.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 5c10ea157425..5bbd60896050 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -26,7 +26,6 @@
26#include <linux/mman.h> 26#include <linux/mman.h>
27#include <linux/proc_fs.h> 27#include <linux/proc_fs.h>
28#include <linux/ioport.h> 28#include <linux/ioport.h>
29#include <linux/config.h>
30#include <linux/mm.h> 29#include <linux/mm.h>
31#include <linux/mmzone.h> 30#include <linux/mmzone.h>
32#include <linux/pagemap.h> 31#include <linux/pagemap.h>
@@ -120,7 +119,6 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
120{ 119{
121 struct sysinfo i; 120 struct sysinfo i;
122 int len; 121 int len;
123 struct page_state ps;
124 unsigned long inactive; 122 unsigned long inactive;
125 unsigned long active; 123 unsigned long active;
126 unsigned long free; 124 unsigned long free;
@@ -129,7 +127,6 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
129 struct vmalloc_info vmi; 127 struct vmalloc_info vmi;
130 long cached; 128 long cached;
131 129
132 get_page_state(&ps);
133 get_zone_counts(&active, &inactive, &free); 130 get_zone_counts(&active, &inactive, &free);
134 131
135/* 132/*
@@ -142,7 +139,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
142 allowed = ((totalram_pages - hugetlb_total_pages()) 139 allowed = ((totalram_pages - hugetlb_total_pages())
143 * sysctl_overcommit_ratio / 100) + total_swap_pages; 140 * sysctl_overcommit_ratio / 100) + total_swap_pages;
144 141
145 cached = get_page_cache_size() - total_swapcache_pages - i.bufferram; 142 cached = global_page_state(NR_FILE_PAGES) -
143 total_swapcache_pages - i.bufferram;
146 if (cached < 0) 144 if (cached < 0)
147 cached = 0; 145 cached = 0;
148 146
@@ -159,19 +157,26 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
159 "SwapCached: %8lu kB\n" 157 "SwapCached: %8lu kB\n"
160 "Active: %8lu kB\n" 158 "Active: %8lu kB\n"
161 "Inactive: %8lu kB\n" 159 "Inactive: %8lu kB\n"
160#ifdef CONFIG_HIGHMEM
162 "HighTotal: %8lu kB\n" 161 "HighTotal: %8lu kB\n"
163 "HighFree: %8lu kB\n" 162 "HighFree: %8lu kB\n"
164 "LowTotal: %8lu kB\n" 163 "LowTotal: %8lu kB\n"
165 "LowFree: %8lu kB\n" 164 "LowFree: %8lu kB\n"
165#endif
166 "SwapTotal: %8lu kB\n" 166 "SwapTotal: %8lu kB\n"
167 "SwapFree: %8lu kB\n" 167 "SwapFree: %8lu kB\n"
168 "Dirty: %8lu kB\n" 168 "Dirty: %8lu kB\n"
169 "Writeback: %8lu kB\n" 169 "Writeback: %8lu kB\n"
170 "AnonPages: %8lu kB\n"
170 "Mapped: %8lu kB\n" 171 "Mapped: %8lu kB\n"
171 "Slab: %8lu kB\n" 172 "Slab: %8lu kB\n"
173 "SReclaimable: %8lu kB\n"
174 "SUnreclaim: %8lu kB\n"
175 "PageTables: %8lu kB\n"
176 "NFS_Unstable: %8lu kB\n"
177 "Bounce: %8lu kB\n"
172 "CommitLimit: %8lu kB\n" 178 "CommitLimit: %8lu kB\n"
173 "Committed_AS: %8lu kB\n" 179 "Committed_AS: %8lu kB\n"
174 "PageTables: %8lu kB\n"
175 "VmallocTotal: %8lu kB\n" 180 "VmallocTotal: %8lu kB\n"
176 "VmallocUsed: %8lu kB\n" 181 "VmallocUsed: %8lu kB\n"
177 "VmallocChunk: %8lu kB\n", 182 "VmallocChunk: %8lu kB\n",
@@ -182,19 +187,27 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
182 K(total_swapcache_pages), 187 K(total_swapcache_pages),
183 K(active), 188 K(active),
184 K(inactive), 189 K(inactive),
190#ifdef CONFIG_HIGHMEM
185 K(i.totalhigh), 191 K(i.totalhigh),
186 K(i.freehigh), 192 K(i.freehigh),
187 K(i.totalram-i.totalhigh), 193 K(i.totalram-i.totalhigh),
188 K(i.freeram-i.freehigh), 194 K(i.freeram-i.freehigh),
195#endif
189 K(i.totalswap), 196 K(i.totalswap),
190 K(i.freeswap), 197 K(i.freeswap),
191 K(ps.nr_dirty), 198 K(global_page_state(NR_FILE_DIRTY)),
192 K(ps.nr_writeback), 199 K(global_page_state(NR_WRITEBACK)),
193 K(ps.nr_mapped), 200 K(global_page_state(NR_ANON_PAGES)),
194 K(ps.nr_slab), 201 K(global_page_state(NR_FILE_MAPPED)),
202 K(global_page_state(NR_SLAB_RECLAIMABLE) +
203 global_page_state(NR_SLAB_UNRECLAIMABLE)),
204 K(global_page_state(NR_SLAB_RECLAIMABLE)),
205 K(global_page_state(NR_SLAB_UNRECLAIMABLE)),
206 K(global_page_state(NR_PAGETABLE)),
207 K(global_page_state(NR_UNSTABLE_NFS)),
208 K(global_page_state(NR_BOUNCE)),
195 K(allowed), 209 K(allowed),
196 K(committed), 210 K(committed),
197 K(ps.nr_page_table_pages),
198 (unsigned long)VMALLOC_TOTAL >> 10, 211 (unsigned long)VMALLOC_TOTAL >> 10,
199 vmi.used >> 10, 212 vmi.used >> 10,
200 vmi.largest_chunk >> 10 213 vmi.largest_chunk >> 10