]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - kernel/cgroup.c
UBUNTU: Ubuntu-raspi2-4.10.0-1003.5
[mirror_ubuntu-zesty-kernel.git] / kernel / cgroup.c
index 53bbca7c48598e44fa5e45f88626027749ca8932..0324faee0d849a1ccfd8999b1d52b074d89f8804 100644 (file)
@@ -2920,11 +2920,12 @@ static ssize_t __cgroup_procs_write(struct kernfs_open_file *of, char *buf,
                tsk = tsk->group_leader;
 
        /*
-        * Workqueue threads may acquire PF_NO_SETAFFINITY and become
-        * trapped in a cpuset, or RT worker may be born in a cgroup
-        * with no rt_runtime allocated.  Just say no.
+        * kthreads may acquire PF_NO_SETAFFINITY during initialization.
+        * If userland migrates such a kthread to a non-root cgroup, it can
+        * become trapped in a cpuset, or RT kthread may be born in a
+        * cgroup with no rt_runtime allocated.  Just say no.
         */
-       if (tsk == kthreadd_task || (tsk->flags & PF_NO_SETAFFINITY)) {
+       if (tsk->no_cgroup_migration || (tsk->flags & PF_NO_SETAFFINITY)) {
                ret = -EINVAL;
                goto out_unlock_rcu;
        }
@@ -5631,7 +5632,7 @@ int __init cgroup_init_early(void)
        return 0;
 }
 
-static u16 cgroup_disable_mask __initdata;
+static u16 cgroup_disable_mask __initdata = 1<<0;
 
 /**
  * cgroup_init - cgroup initialization
@@ -6168,6 +6169,28 @@ static int __init cgroup_no_v1(char *str)
 }
 __setup("cgroup_no_v1=", cgroup_no_v1);
 
+static int __init cgroup_enable(char *str)
+{
+       struct cgroup_subsys *ss;
+       char *token;
+       int i;
+
+       while ((token = strsep(&str, ",")) != NULL) {
+               if (!*token)
+                       continue;
+
+               for_each_subsys(ss, i) {
+                       if (strcmp(token, ss->name) &&
+                           strcmp(token, ss->legacy_name))
+                               continue;
+
+                       cgroup_disable_mask &= ~(1 << i);
+               }
+       }
+       return 1;
+}
+__setup("cgroup_enable=", cgroup_enable);
+
 /**
  * css_tryget_online_from_dir - get corresponding css from a cgroup dentry
  * @dentry: directory dentry of interest