* [-mm] Disable the memory controller by default (v3)
@ 2008-04-08 11:46 Balbir Singh
2008-04-08 14:57 ` Paul Menage
2008-04-08 23:34 ` KAMEZAWA Hiroyuki
0 siblings, 2 replies; 3+ messages in thread
From: Balbir Singh @ 2008-04-08 11:46 UTC (permalink / raw)
To: andi, Andrew Morton
Cc: YAMAMOTO Takashi, Paul Menage, linux-kernel, linux-mm,
Pavel Emelianov, hugh, Balbir Singh, KAMEZAWA Hiroyuki
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 | 17 +++++++++++++----
mm/memcontrol.c | 1 +
3 files changed, 17 insertions(+), 4 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-08 16:04:49.000000000 +0530
@@ -3063,7 +3063,7 @@ static void cgroup_release_agent(struct
mutex_unlock(&cgroup_mutex);
}
-static int __init cgroup_disable(char *str)
+static inline int __init cgroup_turnonoff(char *str, int disable)
{
int i;
char *token;
@@ -3076,13 +3076,22 @@ static int __init cgroup_disable(char *s
struct cgroup_subsys *ss = subsys[i];
if (!strcmp(token, ss->name)) {
- ss->disabled = 1;
- printk(KERN_INFO "Disabling %s control group"
- " subsystem\n", ss->name);
+ ss->disabled = disable;
break;
}
}
}
return 1;
}
+
+static int __init cgroup_disable(char *str)
+{
+ return cgroup_turnonoff(str, 1);
+}
__setup("cgroup_disable=", cgroup_disable);
+
+static int __init cgroup_enable(char *str)
+{
+ return cgroup_turnonoff(str, 0);
+}
+__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
+++ linux-2.6.25-rc8-balbir/mm/memcontrol.c 2008-04-07 16:40:22.000000000 +0530
@@ -1104,4 +1104,5 @@ struct cgroup_subsys mem_cgroup_subsys =
.populate = mem_cgroup_populate,
.attach = mem_cgroup_move_task,
.early_init = 0,
+ .disabled = 1,
};
diff -puN Documentation/kernel-parameters.txt~memory-controller-default-option-off Documentation/kernel-parameters.txt
--- linux-2.6.25-rc8/Documentation/kernel-parameters.txt~memory-controller-default-option-off 2008-04-07 16:38:25.000000000 +0530
+++ linux-2.6.25-rc8-balbir/Documentation/kernel-parameters.txt 2008-04-07 17:53:28.000000000 +0530
@@ -382,8 +382,11 @@ and is between 256 and 4096 characters.
See Documentation/s390/CommonIO for details.
cgroup_disable= [KNL] Disable a particular controller
+ cgroup_enable= [KNL] Enable a particular controller
+ For both cgroup_enable and cgroup_enable
Format: {name of the controller(s) to disable}
{Currently supported controllers - "memory"}
+ {Memory controller is disabled by default}
checkreqprot [SELINUX] Set initial checkreqprot flag value.
Format: { "0" | "1" }
_
--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [-mm] Disable the memory controller by default (v3)
2008-04-08 11:46 [-mm] Disable the memory controller by default (v3) Balbir Singh
@ 2008-04-08 14:57 ` Paul Menage
2008-04-08 23:34 ` KAMEZAWA Hiroyuki
1 sibling, 0 replies; 3+ messages in thread
From: Paul Menage @ 2008-04-08 14:57 UTC (permalink / raw)
To: Balbir Singh
Cc: andi, Andrew Morton, YAMAMOTO Takashi, linux-kernel, linux-mm,
Pavel Emelianov, hugh, KAMEZAWA Hiroyuki
On Tue, Apr 8, 2008 at 4:46 AM, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> 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>
Looks good to me - although I wouldn't bother with the "inline" on
cgroup_turnonoff()
Acked-by: Paul Menage <menage@google.com>
> ---
>
> Documentation/kernel-parameters.txt | 3 +++
> kernel/cgroup.c | 17 +++++++++++++----
> mm/memcontrol.c | 1 +
> 3 files changed, 17 insertions(+), 4 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-08 16:04:49.000000000 +0530
> @@ -3063,7 +3063,7 @@ static void cgroup_release_agent(struct
> mutex_unlock(&cgroup_mutex);
> }
>
> -static int __init cgroup_disable(char *str)
> +static inline int __init cgroup_turnonoff(char *str, int disable)
> {
> int i;
> char *token;
> @@ -3076,13 +3076,22 @@ static int __init cgroup_disable(char *s
> struct cgroup_subsys *ss = subsys[i];
>
> if (!strcmp(token, ss->name)) {
> - ss->disabled = 1;
> - printk(KERN_INFO "Disabling %s control group"
> - " subsystem\n", ss->name);
> + ss->disabled = disable;
> break;
> }
> }
> }
> return 1;
> }
> +
> +static int __init cgroup_disable(char *str)
> +{
> + return cgroup_turnonoff(str, 1);
> +}
> __setup("cgroup_disable=", cgroup_disable);
> +
> +static int __init cgroup_enable(char *str)
> +{
> + return cgroup_turnonoff(str, 0);
> +}
> +__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
> +++ linux-2.6.25-rc8-balbir/mm/memcontrol.c 2008-04-07 16:40:22.000000000 +0530
> @@ -1104,4 +1104,5 @@ struct cgroup_subsys mem_cgroup_subsys =
> .populate = mem_cgroup_populate,
> .attach = mem_cgroup_move_task,
> .early_init = 0,
> + .disabled = 1,
> };
> diff -puN Documentation/kernel-parameters.txt~memory-controller-default-option-off Documentation/kernel-parameters.txt
> --- linux-2.6.25-rc8/Documentation/kernel-parameters.txt~memory-controller-default-option-off 2008-04-07 16:38:25.000000000 +0530
> +++ linux-2.6.25-rc8-balbir/Documentation/kernel-parameters.txt 2008-04-07 17:53:28.000000000 +0530
> @@ -382,8 +382,11 @@ and is between 256 and 4096 characters.
> See Documentation/s390/CommonIO for details.
>
> cgroup_disable= [KNL] Disable a particular controller
> + cgroup_enable= [KNL] Enable a particular controller
> + For both cgroup_enable and cgroup_enable
> Format: {name of the controller(s) to disable}
> {Currently supported controllers - "memory"}
> + {Memory controller is disabled by default}
>
> checkreqprot [SELINUX] Set initial checkreqprot flag value.
> Format: { "0" | "1" }
> _
>
> --
> Warm Regards,
> Balbir Singh
> Linux Technology Center
> IBM, ISTL
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [-mm] Disable the memory controller by default (v3)
2008-04-08 11:46 [-mm] Disable the memory controller by default (v3) Balbir Singh
2008-04-08 14:57 ` Paul Menage
@ 2008-04-08 23:34 ` KAMEZAWA Hiroyuki
1 sibling, 0 replies; 3+ messages in thread
From: KAMEZAWA Hiroyuki @ 2008-04-08 23:34 UTC (permalink / raw)
To: Balbir Singh
Cc: andi, Andrew Morton, YAMAMOTO Takashi, Paul Menage, linux-kernel,
linux-mm, Pavel Emelianov, hugh
On Tue, 08 Apr 2008 17:16:13 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>
>
> 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>
> ---
>
Thank you for this boot option.
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-08 23:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-08 11:46 [-mm] Disable the memory controller by default (v3) Balbir Singh
2008-04-08 14:57 ` Paul Menage
2008-04-08 23:34 ` KAMEZAWA Hiroyuki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox