linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cgroup.c: remove redundant check for mixable cgroup in cgroup_migrate_vet_dst
@ 2022-06-21  9:23 Lin Feng
  2022-06-22 17:49 ` Michal Koutný
  2022-06-27  9:09 ` Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Lin Feng @ 2022-06-21  9:23 UTC (permalink / raw)
  To: tj, lizefan.x, hannes; +Cc: cgroups, linux-kernel, linf

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>
---
 kernel/cgroup/cgroup.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 1779ccddb734..ad4aa08ec988 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -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.
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cgroup.c: remove redundant check for mixable cgroup in cgroup_migrate_vet_dst
  2022-06-21  9:23 [PATCH] cgroup.c: remove redundant check for mixable cgroup in cgroup_migrate_vet_dst Lin Feng
@ 2022-06-22 17:49 ` Michal Koutný
  2022-06-27  9:09 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Koutný @ 2022-06-22 17:49 UTC (permalink / raw)
  To: Lin Feng; +Cc: tj, lizefan.x, hannes, cgroups, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 211 bytes --]

On Tue, Jun 21, 2022 at 05:23:58PM +0800, Lin Feng <linf@wangsu.com> wrote:
> so explicitly checking in cgroup_migrate_vet_dst is unnecessary.

Good catch.

Reviewed-by: Michal Koutný <mkoutny@suse.com>


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cgroup.c: remove redundant check for mixable cgroup in cgroup_migrate_vet_dst
  2022-06-21  9:23 [PATCH] cgroup.c: remove redundant check for mixable cgroup in cgroup_migrate_vet_dst Lin Feng
  2022-06-22 17:49 ` Michal Koutný
@ 2022-06-27  9:09 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2022-06-27  9:09 UTC (permalink / raw)
  To: Lin Feng; +Cc: lizefan.x, hannes, cgroups, linux-kernel

On Tue, Jun 21, 2022 at 05:23:58PM +0800, Lin Feng wrote:
...
> so explicitly checking in cgroup_migrate_vet_dst is unnecessary.
> 
> Signed-off-by: Lin Feng <linf@wangsu.com>

Applied to cgroup/for-5.20.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-27  9:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21  9:23 [PATCH] cgroup.c: remove redundant check for mixable cgroup in cgroup_migrate_vet_dst Lin Feng
2022-06-22 17:49 ` Michal Koutný
2022-06-27  9:09 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).