diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-01 17:53:14 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-14 10:19:06 +0100 |
commit | 660d02b554b97fd4ce08d0a30d16487912687a13 (patch) | |
tree | c8a7a4c06e74a6edab1bd35bbcf3bee7a338e7f8 | |
parent | 360c4d2ef5c026d982407aa975770dfd38af065e (diff) |
cgroup: never migrate kernel threads out of the root cgroup
It won't work anyway.
-rw-r--r-- | src/basic/cgroup-util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index b3e92763c..f96cd6339 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) |