From: Lennart Poettering Date: Tue, 1 Sep 2015 15:53:14 +0000 (+0200) Subject: cgroup: never migrate kernel threads out of the root cgroup X-Git-Tag: v226~54^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b84c7f959dca7b14dde522a443a3fcf2f5c5c2d;p=thirdparty%2Fsystemd.git cgroup: never migrate kernel threads out of the root cgroup It won't work anyway. --- diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 6b3162a35fc..2a6dc2769b4 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -321,6 +321,14 @@ int cg_migrate(const char *cfrom, const char *pfrom, const char *cto, const char if (set_get(s, LONG_TO_PTR(pid)) == LONG_TO_PTR(pid)) continue; + /* Ignore kernel threads. Since they can only + * exist in the root cgroup, we only check for + * them there. */ + if (cfrom && + (isempty(pfrom) || path_equal(pfrom, "/")) && + is_kernel_thread(pid) > 0) + continue; + r = cg_attach(cto, pto, pid); if (r < 0) { if (ret >= 0 && r != -ESRCH)