Skip to content

Commit 7e27cb6

Browse files
Waiman-Longhtejun
authored andcommitted
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: Waiman Long <[email protected]> Reviewed-by: Michal Koutný <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent eee8785 commit 7e27cb6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/cgroup/cpuset.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2535,7 +2535,8 @@ static void cpuset_attach_task(struct cpuset *cs, struct task_struct *task)
25352535
if (cs != &top_cpuset)
25362536
guarantee_online_cpus(task, cpus_attach);
25372537
else
2538-
cpumask_copy(cpus_attach, task_cpu_possible_mask(task));
2538+
cpumask_andnot(cpus_attach, task_cpu_possible_mask(task),
2539+
cs->subparts_cpus);
25392540
/*
25402541
* can_attach beforehand should guarantee that this doesn't
25412542
* fail. TODO: have a better way to handle failure here

0 commit comments

Comments
 (0)