lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <1452597703-7688-1-git-send-email-manjeet.p@samsung.com>
Date:	Tue, 12 Jan 2016 16:51:43 +0530
From:	Manjeet Pawar <manjeet.p@...sung.com>
To:	linux-kernel@...r.kernel.org, manjeet.p@...sung.com,
	v.narang@...sung.com, ajeet.y@...sung.com
Cc:	pankaj.m@...sung.com
Subject: [PATCH] meminfo:Don't Account Shared memory in MemAvailable

Instead of using watermark we should subtract SHMEM from pagecache for 
accounting in available memory

Signed-off-by: Vaneet Narang <v.narang@...sung.com>
Signed-off-by: Manjeet Pawar <manjeet.p@...sung.com>
Reviewed-by: Ajeet Yadav <ajeet.y@...sung.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ