[PATCH for mmotm 3/5] add Mapped(SwapBacked) field to /proc/meminfo

From: KOSAKI Motohiro
Date: Thu Jun 11 2009 - 06:27:35 EST


Subject: [PATCH] add Mapped(SwapBacked) field to /proc/meminfo

Now, We have NR_SWAP_BACKED_FILE_MAPPED statistics. Thus we can also
display it by /proc/meminfo.


example:

$ cat /proc/meminfo
MemTotal: 32275164 kB
MemFree: 31880212 kB
(snip)
Mapped: 28048 kB
Mapped(SwapBacked): 836 kB

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
Cc: Mel Gorman <mel@xxxxxxxxx>
Cc: Wu Fengguang <fengguang.wu@xxxxxxxxx>
---
fs/proc/meminfo.c | 2 ++
1 file changed, 2 insertions(+)

Index: b/fs/proc/meminfo.c
===================================================================
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -81,6 +81,7 @@ static int meminfo_proc_show(struct seq_
"Writeback: %8lu kB\n"
"AnonPages: %8lu kB\n"
"Mapped: %8lu kB\n"
+ "Mapped(SwapBacked): %8lu kB\n"
"Slab: %8lu kB\n"
"SReclaimable: %8lu kB\n"
"SUnreclaim: %8lu kB\n"
@@ -124,6 +125,7 @@ static int meminfo_proc_show(struct seq_
K(global_page_state(NR_WRITEBACK)),
K(global_page_state(NR_ANON_PAGES)),
K(global_page_state(NR_FILE_MAPPED)),
+ K(global_page_state(NR_SWAP_BACKED_FILE_MAPPED)),
K(global_page_state(NR_SLAB_RECLAIMABLE) +
global_page_state(NR_SLAB_UNRECLAIMABLE)),
K(global_page_state(NR_SLAB_RECLAIMABLE)),


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/