summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/cgroup-v2.txt5
-rw-r--r--kernel/cgroup/cgroup.c7
2 files changed, 3 insertions, 9 deletions
diff --git a/Documentation/cgroup-v2.txt b/Documentation/cgroup-v2.txt
index cb9ea281ab72..dec5afdaa36d 100644
--- a/Documentation/cgroup-v2.txt
+++ b/Documentation/cgroup-v2.txt
@@ -274,8 +274,9 @@ thread mode, the following conditions must be met.
- As the cgroup will join the parent's resource domain. The parent
must either be a valid (threaded) domain or a threaded cgroup.
-- The cgroup must be empty. No enabled controllers, child cgroups or
- processes.
+- When the parent is an unthreaded domain, it must not have any domain
+ controllers enabled or populated domain children. The root is
+ exempt from this requirement.
Topology-wise, a cgroup can be in an invalid state. Please consider
the following toplogy::
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index e9a377dc5bdb..e0a558c4d358 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -3147,13 +3147,6 @@ static int cgroup_enable_threaded(struct cgroup *cgrp)
return -EOPNOTSUPP;
/*
- * Allow enabling thread mode only on empty cgroups to avoid
- * implicit migrations and recursive operations.
- */
- if (cgroup_has_tasks(cgrp) || css_has_online_children(&cgrp->self))
- return -EBUSY;
-
- /*
* The following shouldn't cause actual migrations and should
* always succeed.
*/