cgroups: Enable memory controller by default
This commit is contained in:
parent
7aa0b02a27
commit
0ddaf6aed3
|
@ -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 <ben@decadent.org.uk> Wed, 20 Jul 2016 03:50:18 +0100
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
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
|
|
@ -1,95 +0,0 @@
|
|||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
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 <ben@decadent.org.uk>
|
||||
[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;
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue