Skip to content

Commit a977cd5

Browse files
Waiman-LongSasha Levin
authored andcommitted
cgroup/cpuset: Fix incorrect change to effective_xcpus in partition_xcpus_del()
[ Upstream commit f9a1767 ] 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 <chenridong@huaweicloud.com> Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d115b34 commit a977cd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/cgroup/cpuset.c

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

1404-
cpumask_and(xcpus, xcpus, cpu_active_mask);
14051404
cpumask_or(parent->effective_cpus, parent->effective_cpus, xcpus);
1405+
cpumask_and(parent->effective_cpus, parent->effective_cpus, cpu_active_mask);
14061406
}
14071407

14081408
/*

0 commit comments

Comments
 (0)