cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] cpuset: initialize effective masks when clone_children is enabled
@ 2015-02-13  3:19 Zefan Li
       [not found] ` <54DD6D55.2070603-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Zefan Li @ 2015-02-13  3:19 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Christian Brauner, Serge Hallyn, Stéphane Graber, LKML,
	Cgroups

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reported-by: Serge Hallyn <serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> # 3.17+
Signed-off-by: Zefan Li <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-02 16:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13  3:19 [PATCH 1/3] cpuset: initialize effective masks when clone_children is enabled Zefan Li
     [not found] ` <54DD6D55.2070603-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-02-13  3:20   ` [PATCH 2/3] cpuset: fix a warning when clearing configured masks in old hierarchy Zefan Li
2015-02-13  3:21   ` [PATCH 1/3] cpuset: initialize effective masks when clone_children is enabled Zefan Li
2015-02-13  3:58   ` [PATCH 3/3] cpuset: Fix cpuset sched_relax_domain_level Zefan Li
2015-02-13  6:19 ` [PATCH 1/3] cpuset: initialize effective masks when clone_children is enabled Serge E. Hallyn
2015-03-02  6:16 ` Zefan Li
2015-03-02 16:55   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).