Blob Blame History Raw
From: Michal Hocko <mhocko@suse.cz>
Subject: Warn on pagecache limit usage
Patch-mainline: never
References: FATE309111

Let's be verbose about page cache limit usage for support purpose.
The feature is supported only for SLES for SAP appliance and we
should be aware of the fact it is used anyway.

Signed-off-by: Michal Hocko <mhocko@suse.cz>

---
 kernel/sysctl.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1211,6 +1211,9 @@ static struct ctl_table kern_table[] = {
 	{ }
 };
 
+int pc_limit_proc_dointvec(struct ctl_table *table, int write,
+		     void __user *buffer, size_t *lenp, loff_t *ppos);
+
 static struct ctl_table vm_table[] = {
 	{
 		.procname	= "overcommit_memory",
@@ -1342,7 +1345,7 @@ static struct ctl_table vm_table[] = {
 		.data		= &vm_pagecache_limit_mb,
 		.maxlen		= sizeof(vm_pagecache_limit_mb),
 		.mode		= 0644,
-		.proc_handler	= &proc_dointvec,
+		.proc_handler	= &pc_limit_proc_dointvec,
 	},
 	{
 		.procname	= "pagecache_limit_ignore_dirty",
@@ -2198,6 +2201,18 @@ static int do_proc_dointvec(struct ctl_t
 			buffer, lenp, ppos, conv, data);
 }
 
+int pc_limit_proc_dointvec(struct ctl_table *table, int write,
+		     void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+	int ret = do_proc_dointvec(table,write,buffer,lenp,ppos,
+		    	    NULL,NULL);
+	if (write && !ret)
+		printk(KERN_WARNING "pagecache limit set to %d."
+				"Feature is supported only for SLES for SAP appliance\n",
+				vm_pagecache_limit_mb);
+	return ret;
+}
+
 /**
  * proc_dointvec - read a vector of integers
  * @table: the sysctl table