cgroup: never migrate kernel threads out of the root cgroup

It won't work anyway.
This commit is contained in:
Lennart Poettering 2015-09-01 17:53:14 +02:00
parent e9db43d591
commit 9b84c7f959
1 changed files with 8 additions and 0 deletions

View File

@ -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)