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

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 |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1244,6 +1244,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",
@@ -1375,7 +1378,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",
@@ -2455,6 +2458,21 @@ static int do_proc_douintvec(struct ctl_
 				   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);
+		if (num_possible_cpus() > 16)
+			printk(KERN_WARNING "Using page cache limit on large machines is strongly discouraged. See TID 7021211\n");
+	}
+	return ret;
+}
+
 /**
  * proc_dointvec - read a vector of integers
  * @table: the sysctl table