[PATCH 0/2] cgroup/cpuset: Fix partition switch after a sibling releases CPUs
From: Hang Zhengyang
Date: Thu Dec 03 2026 - 14:59:31 EST
Since commit 2a3602030d80 ("cgroup/cpuset: Don't invalidate sibling
partitions on cpuset.cpus conflict"), a partition without
cpuset.cpus.exclusive whose cpuset.cpus overlap the exclusive CPUs of a
sibling gets only the other CPUs. When the sibling releases them, the
partition keeps its CPUs until they are recomputed. A switch between
root and isolated recomputes them and takes the released CPUs without
taking them from the parent, so the CPUs end up in two partitions.
Patch 1 fixes the switch for local and remote partitions. Patch 2 adds
tests.
CPU hotplug recomputes them the same way, so offlining a CPU after the
sibling released its CPUs also leads to overlapping partitions. Chen
Ridong's v6 "cpuset: rework local partition logic" and Waiman Long's v4
"More fix patches" both change that path, so I left it alone. The switch
problem reproduces with either series applied. Another way to fix both
would be to update valid sibling partitions when a cpuset releases
exclusive CPUs. I can do that instead, or rebase on the rework, if you
prefer.
The series is based on cgroup/for-7.4-fixes and also applies to
cgroup/for-next.
Testing:
- Reproduced on v7.0, v7.4-rc5 and next-20261202, not on v6.18 or on
the parent of 2a3602030d80.
- With the series, test_cpuset_prs.sh passes on cgroup/for-7.4-fixes
and next-20261202 with 8 CPUs, and on next-20261202 with 12 CPUs and
isolcpus=10-11. Without patch 1, the new cases fail.
I used Claude Code to find the issue, write the patches and run the
tests. I reviewed the patches.
Hang Zhengyang (2):
cgroup/cpuset: Update the parent when a partition switch adds CPUs
selftests/cgroup: Test partition switches after a sibling releases
CPUs
kernel/cgroup/cpuset.c | 41 ++++++++++++++-----
.../selftests/cgroup/test_cpuset_prs.sh | 14 +++++++
2 files changed, 45 insertions(+), 10 deletions(-)
base-commit: 05afa0c55015b3c7f3c2136dde7fbcfe5195b21f
--
2.53.0