]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cgroup/cpuset: Fix incorrect isolated_cpus update in update_parent_effective_cpumask()
authorWaiman Long <longman@redhat.com>
Sun, 30 Mar 2025 21:52:40 +0000 (17:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:04 +0000 (10:15 +0200)
commit40bc55e4fcbd740731e5f131f4fc9a94a2f86ac8
tree5fcdfd3b008a6d4f092a70f9a0de2ac3fc04cb72
parentb980b832318ca6686d1c077162d45153fae16875
cgroup/cpuset: Fix incorrect isolated_cpus update in update_parent_effective_cpumask()

[ Upstream commit 668e041662e92ab3ebcb9eb606d3ec01884546ab ]

Before commit f0af1bfc27b5 ("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 11e5f407b64a ("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: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions")
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/cgroup/cpuset.c