Skip to content

Commit dacb6cc

Browse files
lizf-ossashalevin
authored andcommitted
cpuset: initialize effective masks when clone_children is enabled
[ Upstream commit 790317e ] If clone_children is enabled, effective masks won't be initialized due to the bug: # mount -t cgroup -o cpuset xxx /mnt # echo 1 > cgroup.clone_children # mkdir /mnt/tmp # cat /mnt/tmp/ # cat cpuset.effective_cpus # cat cpuset.cpus 0-15 And then this cpuset won't constrain the tasks in it. Either the bug or the fix has no effect on unified hierarchy, as there's no clone_chidren flag there any more. Reported-by: Christian Brauner <christianvanbrauner@gmail.com> Reported-by: Serge Hallyn <serge.hallyn@ubuntu.com> Cc: <stable@vger.kernel.org> # 3.17+ Signed-off-by: Zefan Li <lizefan@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org> Tested-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 parent d4bc18f commit dacb6cc

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎kernel/cpuset.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,9 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
19911991

19921992
mutex_lock(&callback_mutex);
19931993
cs->mems_allowed = parent->mems_allowed;
1994+
cs->effective_mems = parent->mems_allowed;
19941995
cpumask_copy(cs->cpus_allowed, parent->cpus_allowed);
1996+
cpumask_copy(cs->effective_cpus, parent->cpus_allowed);
19951997
mutex_unlock(&callback_mutex);
19961998
out_unlock:
19971999
mutex_unlock(&cpuset_mutex);

0 commit comments

Comments
 (0)