[RFC] mm:change meminfo cached calculation

From: Wang, Yalin
Date: Fri Dec 26 2014 - 06:57:07 EST


This patch subtract sharedram from cached,
sharedram can only be swap into swap partitions,
they should be treated as swap pages, not as cached pages.

Signed-off-by: Yalin Wang <yalin.wang@xxxxxxxxxxxxxx>
---
fs/proc/meminfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index d3ebf2e..2b598a6 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -45,7 +45,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
committed = percpu_counter_read_positive(&vm_committed_as);

cached = global_page_state(NR_FILE_PAGES) -
- total_swapcache_pages() - i.bufferram;
+ total_swapcache_pages() - i.bufferram - i.sharedram;
if (cached < 0)
cached = 0;

--
2.1.3
N‹§²æ¸›yú²X¬¶ÇvØ–)Þ{.nlj·¥Š{±‘êX§¶›¡Ü}©ž²ÆzÚj:+v‰¨¾«‘êZ+€Êzf£¢·hšˆ§~†­†Ûÿû®w¥¢¸?™¨è&¢)ßf”ùy§m…á«a¶Úÿ 0¶ìå