Commit 7e27cb6a authored by Waiman Long's avatar Waiman Long Committed by Tejun Heo

cgroup/cpuset: Make cpuset_attach_task() skip subpartitions CPUs for top_cpuset

It is found that attaching a task to the top_cpuset does not currently
ignore CPUs allocated to subpartitions in cpuset_attach_task(). So the
code is changed to fix that.
Signed-off-by: default avatarWaiman Long <longman@redhat.com>
Reviewed-by: default avatarMichal Koutný <mkoutny@suse.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent eee87853
...@@ -2535,7 +2535,8 @@ static void cpuset_attach_task(struct cpuset *cs, struct task_struct *task) ...@@ -2535,7 +2535,8 @@ static void cpuset_attach_task(struct cpuset *cs, struct task_struct *task)
if (cs != &top_cpuset) if (cs != &top_cpuset)
guarantee_online_cpus(task, cpus_attach); guarantee_online_cpus(task, cpus_attach);
else else
cpumask_copy(cpus_attach, task_cpu_possible_mask(task)); cpumask_andnot(cpus_attach, task_cpu_possible_mask(task),
cs->subparts_cpus);
/* /*
* can_attach beforehand should guarantee that this doesn't * can_attach beforehand should guarantee that this doesn't
* fail. TODO: have a better way to handle failure here * fail. TODO: have a better way to handle failure here
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment