From 0ddaf6aed3d33daa8d2d402d7f1d46729009e93c Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 29 Jul 2016 12:23:32 +0100 Subject: [PATCH] cgroups: Enable memory controller by default --- debian/changelog | 1 + debian/config/config | 1 - ...-the-Debian-memory-resource-controll.patch | 18 ---- ...mory-cgroup-support-to-be-included-b.patch | 95 ------------------- debian/patches/series | 2 - 5 files changed, 1 insertion(+), 116 deletions(-) delete mode 100644 debian/patches/debian/cgroups-Document-the-Debian-memory-resource-controll.patch delete mode 100644 debian/patches/features/all/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch diff --git a/debian/changelog b/debian/changelog index 0568c4546..09fc90edd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ linux (4.7~rc7-1~exp2) UNRELEASED; urgency=medium - nfc: NFC_PN533_USB replaced NFC_PN533 - [armhf] dsa: NET_DSA_MV88E6XXX replaced NET_DSA_MV88E6{123,131,171} - [x86] ACPI: ACPI_TABLE_UPGRADE replaced ACPI_INITRD_TABLE_OVERRIDE + * cgroups: Enable memory controller by default -- Ben Hutchings Wed, 20 Jul 2016 03:50:18 +0100 diff --git a/debian/config/config b/debian/config/config index 303d128f7..fb79160b0 100644 --- a/debian/config/config +++ b/debian/config/config @@ -5496,7 +5496,6 @@ CONFIG_NUMA_BALANCING=y # CONFIG_NUMA_BALANCING_DEFAULT_ENABLED is not set CONFIG_CGROUPS=y CONFIG_MEMCG=y -CONFIG_MEMCG_DISABLED=y CONFIG_MEMCG_SWAP=y # CONFIG_MEMCG_SWAP_ENABLED is not set CONFIG_BLK_CGROUP=y diff --git a/debian/patches/debian/cgroups-Document-the-Debian-memory-resource-controll.patch b/debian/patches/debian/cgroups-Document-the-Debian-memory-resource-controll.patch deleted file mode 100644 index 2ac91ca20..000000000 --- a/debian/patches/debian/cgroups-Document-the-Debian-memory-resource-controll.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Ben Hutchings -Subject: cgroups: Document the Debian memory resource controller config change -Forwarded: not-needed - ---- ---- a/Documentation/cgroup-v1/memory.txt -+++ b/Documentation/cgroup-v1/memory.txt -@@ -52,6 +52,10 @@ Features: - Kernel memory support is a work in progress, and the current version provides - basically functionality. (See Section 2.7) - -+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 diff --git a/debian/patches/features/all/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch b/debian/patches/features/all/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch deleted file mode 100644 index 7969b3262..000000000 --- a/debian/patches/features/all/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch +++ /dev/null @@ -1,95 +0,0 @@ -From: Ben Hutchings -Date: Thu, 10 Dec 2015 18:02:48 +0000 -Subject: cgroups: Allow memory cgroup support to be included but disabled -Forwarded: no - -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 -[Bastian Blank: Rename CGROUP_MEM_RES_CTLR_DISABLED to MEMCG_DISABLED] ---- ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -603,8 +603,8 @@ bytes respectively. Such letter suffixes - 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} - The effects of cgroup_disable=foo are: - - foo isn't auto-mounted if you mount all cgroups in - a single hierarchy ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -946,6 +946,14 @@ config MEMCG - help - Provides control over the memory footprint of tasks in a cgroup. - -+config MEMCG_DISABLED -+ bool "Memory Resource Controller disabled by default" -+ depends on MEMCG -+ default n -+ help -+ Disable the memory group resource controller unless explicitly -+ enabled using the kernel parameter "cgroup_enable=memory". -+ - config MEMCG_SWAP - bool "Swap controller" - depends on MEMCG && SWAP ---- a/kernel/cgroup.c -+++ b/kernel/cgroup.c -@@ -5521,7 +5521,11 @@ int __init cgroup_init_early(void) - return 0; - } - -+#ifdef CONFIG_MEMCG_DISABLED -+static u16 cgroup_disable_mask __initdata = 1 << memory_cgrp_id; -+#else - static u16 cgroup_disable_mask __initdata; -+#endif - - /** - * cgroup_init - cgroup initialization -@@ -6003,7 +6007,7 @@ out_free: - kfree(pathbuf); - } - --static int __init cgroup_disable(char *str) -+static int __init cgroup_set_disabled(char *str, int value) - { - struct cgroup_subsys *ss; - char *token; -@@ -6017,13 +6021,27 @@ static int __init cgroup_disable(char *s - if (strcmp(token, ss->name) && - strcmp(token, ss->legacy_name)) - continue; -- cgroup_disable_mask |= 1 << i; -+ if (value) -+ cgroup_disable_mask |= 1 << i; -+ else -+ cgroup_disable_mask &= ~(1 << i); - } - } - 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); -+ - static int __init cgroup_no_v1(char *str) - { - struct cgroup_subsys *ss; diff --git a/debian/patches/series b/debian/patches/series index a74f3bea7..c3ccd06da 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -33,8 +33,6 @@ debian/fs-enable-link-security-restrictions-by-default.patch # Set various features runtime-disabled by default debian/sched-autogroup-disabled.patch -features/all/cgroups-Allow-memory-cgroup-support-to-be-included-b.patch -debian/cgroups-Document-the-Debian-memory-resource-controll.patch debian/yama-disable-by-default.patch debian/add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch