[kernel] r17394 - in dists/trunk/linux-2.6/debian: config patches/debian patches/features/all patches/series
Ben Hutchings
benh at alioth.debian.org
Fri May 13 04:38:46 UTC 2011
Author: benh
Date: Fri May 13 04:38:34 2011
New Revision: 17394
Log:
Disable cgroups memory controller, unless explicitly enabled
This should result in very low run-time overhead, though this is yet
to be measured.
Added:
dists/trunk/linux-2.6/debian/patches/debian/cgroups-Document-the-Debian-memory-resource-controll.patch
dists/trunk/linux-2.6/debian/patches/features/all/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch
dists/trunk/linux-2.6/debian/patches/series/1~experimental.2
Modified:
dists/trunk/linux-2.6/debian/config/config
Modified: dists/trunk/linux-2.6/debian/config/config
==============================================================================
--- dists/trunk/linux-2.6/debian/config/config Thu May 12 03:18:58 2011 (r17393)
+++ dists/trunk/linux-2.6/debian/config/config Fri May 13 04:38:34 2011 (r17394)
@@ -3404,6 +3404,7 @@
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_MEM_RES_CTLR=y
+CONFIG_CGROUP_MEM_RES_CTLR_DISABLED=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_RT_GROUP_SCHED is not set
Added: dists/trunk/linux-2.6/debian/patches/debian/cgroups-Document-the-Debian-memory-resource-controll.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/trunk/linux-2.6/debian/patches/debian/cgroups-Document-the-Debian-memory-resource-controll.patch Fri May 13 04:38:34 2011 (r17394)
@@ -0,0 +1,28 @@
+From 969e4dd0b5c715b239c765b870f2abf81c57e878 Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Sun, 30 May 2010 22:47:01 +0100
+Subject: [PATCH 2/2] cgroups: Document the Debian memory resource controller
+ config change
+
+---
+ Documentation/cgroups/memory.txt | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
+index 7c16347..684f70d 100644
+--- a/Documentation/cgroups/memory.txt
++++ b/Documentation/cgroups/memory.txt
+@@ -47,6 +47,10 @@ Features:
+ Kernel memory and Hugepages are not under control yet. We just manage
+ pages on LRU. To add more controls, we have to take care of performance.
+
++NOTE: In Debian kernel packages, the memory resource controller is
++included but disabled by default. Use the kernel parameter
++'cgroup_enable=memory' to enable it.
++
+ Brief summary of control files.
+
+ tasks # attach a task(thread) and show list of threads
+--
+1.7.4.4
+
Added: dists/trunk/linux-2.6/debian/patches/features/all/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/trunk/linux-2.6/debian/patches/features/all/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch Fri May 13 04:38:34 2011 (r17394)
@@ -0,0 +1,115 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Sun, 30 May 2010 22:43:38 +0100
+Subject: [PATCH 1/2] cgroups: Allow memory cgroup support to be included but
+ disabled
+
+Memory cgroup support has some run-time overhead, so it's useful to
+include it in a distribution kernel without enabling it by default.
+Add a kernel config option to disable it by default and a kernel
+parameter 'cgroup_enable' as the opposite to 'cgroup_disable'.
+
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+---
+ Documentation/kernel-parameters.txt | 4 ++--
+ init/Kconfig | 8 ++++++++
+ kernel/cgroup.c | 20 ++++++++++++++++----
+ mm/memcontrol.c | 3 +++
+ 4 files changed, 29 insertions(+), 6 deletions(-)
+
+diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
+index cc85a92..38e0b44 100644
+--- a/Documentation/kernel-parameters.txt
++++ b/Documentation/kernel-parameters.txt
+@@ -425,8 +425,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+ ccw_timeout_log [S390]
+ See Documentation/s390/CommonIO for details.
+
+- cgroup_disable= [KNL] Disable a particular controller
+- Format: {name of the controller(s) to disable}
++ cgroup_disable= [KNL] Disable/enable a particular controller
++ cgroup_enable= Format: {name of the controller(s) to disable/enable}
+ {Currently supported controllers - "memory"}
+
+ checkreqprot [SELINUX] Set initial checkreqprot flag value.
+diff --git a/init/Kconfig b/init/Kconfig
+index d886b1e..3410369 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -659,6 +659,14 @@ config CGROUP_MEM_RES_CTLR
+ This config option also selects MM_OWNER config option, which
+ could in turn add some fork/exit overhead.
+
++config CGROUP_MEM_RES_CTLR_DISABLED
++ bool "Memory Resource Controller disabled by default"
++ depends on CGROUP_MEM_RES_CTLR
++ default n
++ help
++ Disable the memory group resource controller unless explicitly
++ enabled using the kernel parameter "cgroup_enable=memory".
++
+ config CGROUP_MEM_RES_CTLR_SWAP
+ bool "Memory Resource Controller Swap Extension"
+ depends on CGROUP_MEM_RES_CTLR && SWAP
+diff --git a/kernel/cgroup.c b/kernel/cgroup.c
+index 25c7eb5..b3c5aa7 100644
+--- a/kernel/cgroup.c
++++ b/kernel/cgroup.c
+@@ -4526,7 +4526,7 @@ static void cgroup_release_agent(struct work_struct *work)
+ mutex_unlock(&cgroup_mutex);
+ }
+
+-static int __init cgroup_disable(char *str)
++static int __init cgroup_set_disabled(char *str, int value)
+ {
+ int i;
+ char *token;
+@@ -4542,17 +4542,29 @@ static int __init cgroup_disable(char *str)
+ 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 = value;
++ printk(KERN_INFO
++ "%sabling %s control group subsystem\n",
++ value ? "Dis" : "En", ss->name);
+ break;
+ }
+ }
+ }
+ return 1;
+ }
++
++static int __init cgroup_disable(char *str)
++{
++ return cgroup_set_disabled(str, 1);
++}
+ __setup("cgroup_disable=", cgroup_disable);
+
++static int __init cgroup_enable(char *str)
++{
++ return cgroup_set_disabled(str, 0);
++}
++__setup("cgroup_enable=", cgroup_enable);
++
+ /*
+ * Functons for CSS ID.
+ */
+diff --git a/mm/memcontrol.c b/mm/memcontrol.c
+index 010f916..f660a07 100644
+--- a/mm/memcontrol.c
++++ b/mm/memcontrol.c
+@@ -5153,6 +5153,9 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss,
+
+ struct cgroup_subsys mem_cgroup_subsys = {
+ .name = "memory",
++#ifdef CONFIG_CGROUP_MEM_RES_CTLR_DISABLED
++ .disabled = 1,
++#endif
+ .subsys_id = mem_cgroup_subsys_id,
+ .create = mem_cgroup_create,
+ .pre_destroy = mem_cgroup_pre_destroy,
+--
+1.7.4.4
+
Added: dists/trunk/linux-2.6/debian/patches/series/1~experimental.2
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/trunk/linux-2.6/debian/patches/series/1~experimental.2 Fri May 13 04:38:34 2011 (r17394)
@@ -0,0 +1,2 @@
++ features/all/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch
++ debian/cgroups-Document-the-Debian-memory-resource-controll.patch
More information about the Kernel-svn-changes
mailing list