Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions")
Reviewed-by: Chen Ridong <chenridong@huaweicloud.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Waiman Long and committed by
Tejun Heo
f9a1767c 5ee01f1a

+1 -1
+1 -1
kernel/cgroup/cpuset.c
··· 1221 1221 isolated_cpus_update(old_prs, parent->partition_root_state, 1222 1222 xcpus); 1223 1223 1224 - cpumask_and(xcpus, xcpus, cpu_active_mask); 1225 1224 cpumask_or(parent->effective_cpus, parent->effective_cpus, xcpus); 1225 + cpumask_and(parent->effective_cpus, parent->effective_cpus, cpu_active_mask); 1226 1226 } 1227 1227 1228 1228 /*