diff options
| author | Ridong Chen <chenridong@xiaomi.com> | 2026-11-07 20:00:57 +0800 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-11-09 05:23:03 -1000 |
| commit | ba4834fc81ddc0b500843c827c09d3ff95a317a9 (patch) | |
| tree | 4888d4fb82110c8c46bd4254cb8a2da983512710 /scripts/Makefile.thinlto | |
| parent | e1aed52b68a361f6fc047b24a37d9ec4d928a158 (diff) | |
| download | linux-next-ba4834fc81ddc0b500843c827c09d3ff95a317a9.tar.gz linux-next-ba4834fc81ddc0b500843c827c09d3ff95a317a9.zip | |
cgroup/cpuset: Reset partition data when an invalid partition stays invalid
When cpuset.cpus or cpuset.cpus.exclusive of a partition root is
changed, update_cpumask() and update_exclusive_cpumask() copy the new
effective_xcpus computed for the trial cpuset into the cpuset, and call
reset_partition_data() only if the partition was valid before and is
invalid now:
if ((old_prs > 0) && !is_partition_valid(cs))
reset_partition_data(cs);
An invalid partition root (old_prs < 0) that stays invalid is not
covered. Its effective_xcpus is then left with the trial value, which
is computed from user_xcpus() and so falls back to cpuset.cpus when
cpuset.cpus.exclusive is cleared. As an invalid partition root does not
own any exclusive CPUs, and rm_siblings_excl_cpus() treats a non-empty
effective_xcpus of a sibling without cpuset.cpus.exclusive as owned,
those CPUs can then no longer be claimed by a sibling:
# A1: cpuset.cpus=2-3, cpuset.cpus.exclusive=2-3, root, with tasks
# offline CPUs 2-3 -> A1 becomes invalid
echo > A1/cpuset.cpus.exclusive
cat A1/cpuset.cpus.exclusive.effective # 2-3, expected empty
echo 3 > B1/cpuset.cpus.exclusive # -EINVAL
Reset the partition data whenever the cpuset is a partition root, valid
or not, and ends up invalid. As effective_xcpus may be cleared by that,
also force update_cpumasks_hier() to update the subtree, so that the
effective_xcpus of the descendants doesn't keep the released CPUs. Add
test cases for it.
Fixes: de9f15e21c55 ("cpuset: use parse_cpulist for setting cpus.exclusive")
Fixes: c5866c9a007d ("cpuset: refactor CPU mask buffer parsing logic")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20261101114206.2434398-1-ridong.chen%40linux.dev?part=15
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Ridong Chen <chenridong@xiaomi.com>
Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
