Skip to content

Commit 651daba

Browse files
committed
cgroup/cpuset: Fix incorrect isolated_cpus update in update_parent_effective_cpumask()
jira NONE_AUTOMATION Rebuild_History Non-Buildable kernel-5.14.0-570.17.1.el9_6 commit-author Waiman Long <[email protected]> commit 668e041 Before commit f0af1bf ("cgroup/cpuset: Relax constraints to partition & cpus changes"), a cpuset partition cannot be enabled if not all the requested CPUs can be granted from the parent cpuset. After that commit, a cpuset partition can be created even if the requested exclusive CPUs contain CPUs not allowed its parent. The delmask containing exclusive CPUs to be removed from its parent wasn't adjusted accordingly. That is not a problem until the introduction of a new isolated_cpus mask in commit 11e5f40 ("cgroup/cpuset: Keep track of CPUs in isolated partitions") as the CPUs in the delmask may be added directly into isolated_cpus. As a result, isolated_cpus may incorrectly contain CPUs that are not isolated leading to incorrect data reporting. Fix this by adjusting the delmask to reflect the actual exclusive CPUs for the creation of the partition. Fixes: 11e5f40 ("cgroup/cpuset: Keep track of CPUs in isolated partitions") Signed-off-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]> (cherry picked from commit 668e041) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 84db0e0 commit 651daba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/cgroup/cpuset.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,9 +1952,9 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
19521952
if (nocpu)
19531953
return PERR_NOCPUS;
19541954

1955-
cpumask_copy(tmp->delmask, xcpus);
1956-
deleting = true;
1957-
subparts_delta++;
1955+
deleting = cpumask_and(tmp->delmask, xcpus, parent->effective_xcpus);
1956+
if (deleting)
1957+
subparts_delta++;
19581958
new_prs = (cmd == partcmd_enable) ? PRS_ROOT : PRS_ISOLATED;
19591959
} else if (cmd == partcmd_disable) {
19601960
/*

0 commit comments

Comments
 (0)