]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
cgroup.c: remove redundant check for mixable cgroup in cgroup_migrate_vet_dst
authorLin Feng <linf@wangsu.com>
Tue, 21 Jun 2022 09:23:58 +0000 (17:23 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 27 Jun 2022 09:09:21 +0000 (18:09 +0900)
We have:
int cgroup_migrate_vet_dst(struct cgroup *dst_cgrp)
{
...
/* mixables don't care */
if (cgroup_is_mixable(dst_cgrp))
return 0;

/*
 * If @dst_cgrp is already or can become a thread root or is
 * threaded, it doesn't matter.
 */
if (cgroup_can_be_thread_root(dst_cgrp) || cgroup_is_threaded(dst_cgrp))
return 0;
...
}

but in fact the entry of cgroup_can_be_thread_root() covers case that
checking cgroup_is_mixable() as following:
static bool cgroup_can_be_thread_root(struct cgroup *cgrp)
{
        /* mixables don't care */
        if (cgroup_is_mixable(cgrp))
                return true;
...
}

so explicitly checking in cgroup_migrate_vet_dst is unnecessary.

Signed-off-by: Lin Feng <linf@wangsu.com>
Reviewed-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c

index 4b67e6da6bf215c2589799b3beb3142a6e30de1d..64e0f644adfacfebbcf5b66a04eb9d01704d3c9d 100644 (file)
@@ -2566,10 +2566,6 @@ int cgroup_migrate_vet_dst(struct cgroup *dst_cgrp)
        if (!cgroup_is_valid_domain(dst_cgrp->dom_cgrp))
                return -EOPNOTSUPP;
 
-       /* mixables don't care */
-       if (cgroup_is_mixable(dst_cgrp))
-               return 0;
-
        /*
         * If @dst_cgrp is already or can become a thread root or is
         * threaded, it doesn't matter.