cgroup.c: remove redundant check for mixable cgroup in cgroup_migrate_vet_dst
PATCH 1/1 cgroup.c: remove redundant check for mixable cgroup in cgroup_migrate_vet_dst
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 <[email protected]>
--- kernel/cgroup/cgroup.c | 4 ---- 1 file changed, 4 deletions(-)
kernel/cgroup/cgroup.c +0 -4
@@ -2570,10 +2570,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.
Signature · 1 line
2.31.1
Quoted 1 line · Lin Feng
so explicitly checking in
cgroup_migrate_vet_dstis unnecessary.
Good catch.
Reviewed-by Michal Koutný <mkoutny-IBi9RG/[email protected]>
On Tue, Jun 21, 2022 at 05:23:58PM +0800, Lin Feng wrote:
...
Quoted 3 lines
so explicitly checking in
cgroup_migrate_vet_dstis unnecessary.Signed-off-by Lin Feng <[email protected]>
Applied to cgroup/for-5.20.
Thanks.
Signature · 1 line
tejun