]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Revert "api: cgroup v2 – enable controller at the leaf node"
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 12 Apr 2023 14:49:45 +0000 (20:19 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 12 Apr 2023 17:07:41 +0000 (11:07 -0600)
This reverts commit bb291add5db87fe36a82a18c6eb6aaf64dc07694.

cgroup v2, has no internal process constraint, where the process runs
only on the leaf node of the cgroup hierarchy and no controllers should
be enabled on the leaf cgroup node too, so that they don't compete with
the parent's internal process. This patch broke this rule by enabling
the controller on the leaf node by default. Let's revert to the original
approach of not enabling the controller on the leaf cgroup node.

Signed-by-off: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit 9479fedff122ea44c887efafde2aaa3a51f0c623)

src/api.c

index ccee631746ec891861ec33b1a95de65570f3943a..8a2ccd3ce270fb83697e75698e11bb0228728b44 100644 (file)
--- a/src/api.c
+++ b/src/api.c
@@ -2847,12 +2847,6 @@ static int _cgroup_create_cgroup(const struct cgroup * const cgroup,
                goto err;
 
        if (controller) {
-               if (version == CGROUP_V2) {
-                       error = cgroupv2_subtree_control(base, controller->name, true);
-                       if (error)
-                               goto err;
-               }
-
                error = cgroup_set_values_recursive(base, controller, false);
                if (error)
                        goto err;