[PATCH] meminfo:Don't Account Shared memory in MemAvailable
From: Manjeet Pawar
Date: Tue Jan 12 2016 - 06:22:18 EST
Instead of using watermark we should subtract SHMEM from pagecache for
accounting in available memory
Signed-off-by: Vaneet Narang <v.narang@xxxxxxxxxxx>
Signed-off-by: Manjeet Pawar <manjeet.p@xxxxxxxxxxx>
Reviewed-by: Ajeet Yadav <ajeet.y@xxxxxxxxxxx>
---
fs/proc/meminfo.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index d3ebf2e..36e3eb5 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -72,7 +72,10 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
* low watermark worth of cache, needs to stay.
*/
pagecache = pages[LRU_ACTIVE_FILE] + pages[LRU_INACTIVE_FILE];
- pagecache -= min(pagecache / 2, wmark_low);
+ /*
+ * Do not Account shared memory as available memory
+ */
+ pagecache -= global_page_state(NR_SHMEM);
available += pagecache;
/*
--
1.7.9.5