[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <54DD6D55.2070603@huawei.com>
Date: Fri, 13 Feb 2015 11:19:49 +0800
From: Zefan Li <lizefan@...wei.com>
To: Tejun Heo <tj@...nel.org>
CC: Christian Brauner <christianvanbrauner@...il.com>,
Serge Hallyn <serge.hallyn@...ntu.com>,
Stéphane Graber <stgraber@...ntu.com>,
LKML <linux-kernel@...r.kernel.org>,
Cgroups <cgroups@...r.kernel.org>
Subject: [PATCH 1/3] cpuset: initialize effective masks when clone_children
is enabled
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@...il.com>
Reported-by: Serge Hallyn <serge.hallyn@...ntu.com>
Cc: <stable@...r.kernel.org> # 3.17+
Signed-off-by: Zefan Li <lizefan@...wei.com>
---
kernel/cpuset.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 64b257f..7e9d711 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1992,7 +1992,9 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
spin_lock_irq(&callback_lock);
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);
spin_unlock_irq(&callback_lock);
out_unlock:
mutex_unlock(&cpuset_mutex);
--
1.8.0.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists