Skip to content

Commit f9a1767

Browse files
Waiman-Longhtejun
authored andcommitted
cgroup/cpuset: Fix incorrect change to effective_xcpus in partition_xcpus_del()
The effective_xcpus of a cpuset can contain offline CPUs. In partition_xcpus_del(), the xcpus parameter is incorrectly used as a temporary cpumask to mask out offline CPUs. As xcpus can be the effective_xcpus of a cpuset, this can result in unexpected changes in that cpumask. Fix this problem by not making any changes to the xcpus parameter. Fixes: 11e5f40 ("cgroup/cpuset: Keep track of CPUs in isolated partitions") Reviewed-by: Chen Ridong <[email protected]> Signed-off-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 5ee01f1 commit f9a1767

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/cgroup/cpuset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,8 +1221,8 @@ static void partition_xcpus_del(int old_prs, struct cpuset *parent,
12211221
isolated_cpus_update(old_prs, parent->partition_root_state,
12221222
xcpus);
12231223

1224-
cpumask_and(xcpus, xcpus, cpu_active_mask);
12251224
cpumask_or(parent->effective_cpus, parent->effective_cpus, xcpus);
1225+
cpumask_and(parent->effective_cpus, parent->effective_cpus, cpu_active_mask);
12261226
}
12271227

12281228
/*

0 commit comments

Comments
 (0)