summaryrefslogtreecommitdiff
path: root/src/basic/cgroup-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-01 17:53:14 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-01 18:37:01 +0200
commit9b84c7f959dca7b14dde522a443a3fcf2f5c5c2d (patch)
tree59471cc4cb392917bc4b3d2e9af3e29cde712d6e /src/basic/cgroup-util.c
parente9db43d5910717a1084924c512bf85e2b8265375 (diff)
cgroup: never migrate kernel threads out of the root cgroup
It won't work anyway.
Diffstat (limited to 'src/basic/cgroup-util.c')
-rw-r--r--src/basic/cgroup-util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 6b3162a35f..2a6dc2769b 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)