Skip to content

Commit 0a679e1

Browse files
committed
Merge branch 'for-5.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fix from Tejun Heo: "I made a mistake while removing cgroup task list lazy init optimization making the root cgroup.procs show entries for the init_tasks. The zero entries doesn't cause critical failures but does make systemd print out warning messages during boot. Fix it by omitting init_tasks as they should be" * 'for-5.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: init_tasks shouldn't be linked to the root cgroup
2 parents a5650ac + 0cd9d33 commit 0a679e1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

kernel/cgroup/cgroup.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5927,11 +5927,14 @@ void cgroup_post_fork(struct task_struct *child)
59275927

59285928
spin_lock_irq(&css_set_lock);
59295929

5930-
WARN_ON_ONCE(!list_empty(&child->cg_list));
5931-
cset = task_css_set(current); /* current is @child's parent */
5932-
get_css_set(cset);
5933-
cset->nr_tasks++;
5934-
css_set_move_task(child, NULL, cset, false);
5930+
/* init tasks are special, only link regular threads */
5931+
if (likely(child->pid)) {
5932+
WARN_ON_ONCE(!list_empty(&child->cg_list));
5933+
cset = task_css_set(current); /* current is @child's parent */
5934+
get_css_set(cset);
5935+
cset->nr_tasks++;
5936+
css_set_move_task(child, NULL, cset, false);
5937+
}
59355938

59365939
/*
59375940
* If the cgroup has to be frozen, the new task has too. Let's set

0 commit comments

Comments
 (0)