summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorZefan Li <lizefan@huawei.com>2015-02-13 11:19:49 +0800
committerSasha Levin <sasha.levin@oracle.com>2015-03-28 09:42:38 -0400
commitdacb6ccdcc8374f9d100c23d50087b8cb1fd0eb3 (patch)
treeaec244ab446f843b95a9b2b5f661788c0e08ced8 /kernel
parentd4bc18f7bbd9aa62b1794fe8f409bd0c1b88a597 (diff)
cpuset: initialize effective masks when clone_children is enabled
[ Upstream commit 790317e1b266c776765a4bdcedefea706ff0fada ] 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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpuset.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 1f107c74087b..7e59b7b37f0f 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1991,7 +1991,9 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
mutex_lock(&callback_mutex);
cs->mems_allowed = parent->mems_allowed;
+ cs->effective_mems = parent->mems_allowed;
cpumask_copy(cs->cpus_allowed, parent->cpus_allowed);
+ cpumask_copy(cs->effective_cpus, parent->cpus_allowed);
mutex_unlock(&callback_mutex);
out_unlock:
mutex_unlock(&cpuset_mutex);