Commit 4b856152 authored by KOSAKI Motohiro's avatar KOSAKI Motohiro Committed by Linus Torvalds

mm: show quicklist usage in /proc/meminfo

Quicklists can consume several GB of memory.  We should provide a means of
monitoring this.

After this patch is applied, /proc/meminfo will output the following:

% cat /proc/meminfo

MemTotal:      7715392 kB
MemFree:       5401600 kB
Buffers:         80384 kB
Cached:         300800 kB
SwapCached:          0 kB
Active:         235584 kB
Inactive:       262656 kB
SwapTotal:     2031488 kB
SwapFree:      2031488 kB
Dirty:            3520 kB
Writeback:           0 kB
AnonPages:      117696 kB
Mapped:          38528 kB
Slab:          1589952 kB
SReclaimable:    23104 kB
SUnreclaim:    1566848 kB
PageTables:      14656 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
WritebackTmp:        0 kB
CommitLimit:   5889152 kB
Committed_AS:   393152 kB
VmallocTotal: 17592177655808 kB
VmallocUsed:     29056 kB
VmallocChunk: 17592177626432 kB
Quicklists:     130944 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
HugePages_Surp:      0
Hugepagesize:    262144 kB
Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Keiichiro Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 36fd71d2
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/mman.h> #include <linux/mman.h>
#include <linux/quicklist.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -189,7 +190,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off, ...@@ -189,7 +190,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
"Committed_AS: %8lu kB\n" "Committed_AS: %8lu kB\n"
"VmallocTotal: %8lu kB\n" "VmallocTotal: %8lu kB\n"
"VmallocUsed: %8lu kB\n" "VmallocUsed: %8lu kB\n"
"VmallocChunk: %8lu kB\n", "VmallocChunk: %8lu kB\n"
"Quicklists: %8lu kB\n",
K(i.totalram), K(i.totalram),
K(i.freeram), K(i.freeram),
K(i.bufferram), K(i.bufferram),
...@@ -221,7 +223,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off, ...@@ -221,7 +223,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
K(committed), K(committed),
(unsigned long)VMALLOC_TOTAL >> 10, (unsigned long)VMALLOC_TOTAL >> 10,
vmi.used >> 10, vmi.used >> 10,
vmi.largest_chunk >> 10 vmi.largest_chunk >> 10,
K(quicklist_total_size())
); );
len += hugetlb_report_meminfo(page + len); len += hugetlb_report_meminfo(page + len);
......
...@@ -80,6 +80,13 @@ void quicklist_trim(int nr, void (*dtor)(void *), ...@@ -80,6 +80,13 @@ void quicklist_trim(int nr, void (*dtor)(void *),
unsigned long quicklist_total_size(void); unsigned long quicklist_total_size(void);
#else
static inline unsigned long quicklist_total_size(void)
{
return 0;
}
#endif #endif
#endif /* LINUX_QUICKLIST_H */ #endif /* LINUX_QUICKLIST_H */
......
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