cgroup: Retain support for cgroup_memory=1
authorPhil Elwell <phil@raspberrypi.org>
Mon, 27 Nov 2017 17:29:08 +0000 (17:29 +0000)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:57:25 +0000 (15:57 +0100)
As part of a misguided fix for the automatic disabling of cgroup
memory, a new kernel parameter "cgroup_memory" was added. This
extra parameter is unnecessary now that implicit memory cgroup
disabling works correctly, but some unfortunate users may have
come to rely on it.

See: https://github.com/raspberrypi/issues/1950

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
kernel/cgroup.c

index 49b0ca043a65b2add87a85fbe7b81e85852c8b62..29f27f76baa68dfd9fea7d31554cc265dac1c9e0 100644 (file)
@@ -5639,6 +5639,7 @@ int __init cgroup_init_early(void)
 
 static u16 cgroup_disable_mask __initdata;
 static u16 cgroup_enable_mask __initdata;
+static bool cgroup_enable_memory;
 static int __init cgroup_disable(char *str);
 
 /**
@@ -5679,7 +5680,8 @@ int __init cgroup_init(void)
        mutex_unlock(&cgroup_mutex);
 
        /* Apply an implicit disable... */
-       cgroup_disable("memory");
+       if (!cgroup_enable_memory)
+               cgroup_disable("memory");
 
        /* ...knowing that an explicit enable will override it. */
        cgroup_disable_mask &= ~cgroup_enable_mask;
@@ -6208,6 +6210,12 @@ static int __init cgroup_enable(char *str)
 }
 __setup("cgroup_enable=", cgroup_enable);
 
+static int __init cgroup_memory(char *str)
+{
+       return !kstrtobool(str, &cgroup_enable_memory);
+}
+__setup("cgroup_memory=", cgroup_memory);
+
 /**
  * css_tryget_online_from_dir - get corresponding css from a cgroup dentry
  * @dentry: directory dentry of interest