From: Mike Yuan Date: Tue, 30 Jul 2024 18:35:10 +0000 (+0200) Subject: cgroup-setup: kernel threads can reside in arbitrary cgroups X-Git-Tag: v257-rc1~753^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e6d305573458c640b97046667bb39a0d0e6bfa8;p=thirdparty%2Fsystemd.git cgroup-setup: kernel threads can reside in arbitrary cgroups Realistically this doesn't matter, as cg_migrate() is only used to populate init.scope. But it's probably better to make things clear. --- diff --git a/src/shared/cgroup-setup.c b/src/shared/cgroup-setup.c index 62927773697..cf7a0eb2720 100644 --- a/src/shared/cgroup-setup.c +++ b/src/shared/cgroup-setup.c @@ -639,10 +639,7 @@ int cg_migrate( if (set_contains(s, PID_TO_PTR(pid))) continue; - /* Ignore kernel threads. Since they can only exist in the root cgroup, we only - * check for them there. */ - if (cfrom && empty_or_root(pfrom) && - pid_is_kernel_thread(pid) > 0) + if (pid_is_kernel_thread(pid) > 0) continue; r = cg_attach(cto, pto, pid);