Re: [-mm] Disable the memory controller by default (v2)

Previous thread: 2.6.25-rc8-git5: Reported regressions from 2.6.24 by Rafael J. Wysocki on Monday, April 7, 2008 - 8:59 am. (13 messages)

Next thread: Divulgue seu Site ou by Oportunidade - AnuncieOnline.net on Monday, April 7, 2008 - 9:17 am. (1 message)
To: <andi@...>, Andrew Morton <akpm@...>
Cc: YAMAMOTO Takashi <yamamoto@...>, Paul Menage <menage@...>, <linux-kernel@...>, <linux-mm@...>, Pavel Emelianov <xemul@...>, <hugh@...>, Balbir Singh <balbir@...>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>
Date: Monday, April 7, 2008 - 9:02 am

Changelog v1

1. Split cgroup_disable into cgroup_disable and cgroup_enable
2. Remove cgroup_toggle

Due to the overhead of the memory controller. The
memory controller is now disabled by default. This patch adds cgroup_enable.

If everyone agrees on this approach and likes it, should we push this
into 2.6.25?

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
---

Documentation/kernel-parameters.txt | 3 +++
kernel/cgroup.c | 28 ++++++++++++++++++++++++++--
mm/memcontrol.c | 1 +
3 files changed, 30 insertions(+), 2 deletions(-)

diff -puN kernel/cgroup.c~memory-controller-default-option-off kernel/cgroup.c
--- linux-2.6.25-rc8/kernel/cgroup.c~memory-controller-default-option-off 2008-04-07 16:24:28.000000000 +0530
+++ linux-2.6.25-rc8-balbir/kernel/cgroup.c 2008-04-07 18:30:31.000000000 +0530
@@ -3077,8 +3077,8 @@ static int __init cgroup_disable(char *s

if (!strcmp(token, ss->name)) {
ss->disabled = 1;
- printk(KERN_INFO "Disabling %s control group"
- " subsystem\n", ss->name);
+ printk(KERN_INFO "%s control group "
+ "is disabled\n", ss->name);
break;
}
}
@@ -3086,3 +3086,27 @@ static int __init cgroup_disable(char *s
return 1;
}
__setup("cgroup_disable=", cgroup_disable);
+
+static int __init cgroup_enable(char *str)
+{
+ int i;
+ char *token;
+
+ while ((token = strsep(&str, ",")) != NULL) {
+ if (!*token)
+ continue;
+
+ for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
+ struct cgroup_subsys *ss = subsys[i];
+
+ if (!strcmp(token, ss->name)) {
+ ss->disabled = 0;
+ printk(KERN_INFO "%s control group "
+ "is enabled\n", ss->name);
+ break;
+ }
+ }
+ }
+ return 1;
+}
+__setup("cgroup_enable=", cgroup_enable);
diff -puN mm/memcontrol.c~memory-controller-default-option-off mm/memcontrol.c
--- linux-2.6.25-rc8/mm/memcontrol.c~memory-controller-default-option-off 2008-04-07 16:24:28.000000000 +0530...

To: Balbir Singh <balbir@...>
Cc: <andi@...>, Andrew Morton <akpm@...>, YAMAMOTO Takashi <yamamoto@...>, Paul Menage <menage@...>, <linux-kernel@...>, <linux-mm@...>, Pavel Emelianov <xemul@...>, <hugh@...>
Date: Monday, April 7, 2008 - 9:09 pm

On Mon, 07 Apr 2008 18:32:15 +0530
BTW, how the user can know which controllers are on/off at default ?
All controllers are off ?

Thanks,
-Kame

--

To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>
Cc: <andi@...>, Andrew Morton <akpm@...>, YAMAMOTO Takashi <yamamoto@...>, Paul Menage <menage@...>, <linux-kernel@...>, <linux-mm@...>, Pavel Emelianov <xemul@...>, <hugh@...>
Date: Monday, April 7, 2008 - 10:31 pm

/proc/cgroups has an enabled field (fourth one). That should show what is
enabled/disabled. I've also documented it in
Documentation/kernel-parameters.txt. I intend to enable the memory controller
again, once we bring down the overhead.

--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--

To: Balbir Singh <balbir@...>
Cc: <andi@...>, Andrew Morton <akpm@...>, YAMAMOTO Takashi <yamamoto@...>, <linux-kernel@...>, <linux-mm@...>, Pavel Emelianov <xemul@...>, <hugh@...>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>
Date: Monday, April 7, 2008 - 1:43 pm

Good idea - but you could just use the same handler function for both
of these (with a one-line wrapper for each to pass disabled=1 or
disabled=0)

Paul
--

To: Balbir Singh <balbir@...>
Cc: <andi@...>, Andrew Morton <akpm@...>, YAMAMOTO Takashi <yamamoto@...>, Paul Menage <menage@...>, <linux-kernel@...>, <linux-mm@...>, Pavel Emelianov <xemul@...>, <hugh@...>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>
Date: Monday, April 7, 2008 - 9:22 am

Acked-by: KOSAKI Motohiro<kosaki.motohiro@jp.fujitsu.com>
--

Previous thread: 2.6.25-rc8-git5: Reported regressions from 2.6.24 by Rafael J. Wysocki on Monday, April 7, 2008 - 8:59 am. (13 messages)

Next thread: Divulgue seu Site ou by Oportunidade - AnuncieOnline.net on Monday, April 7, 2008 - 9:17 am. (1 message)