[PATCH RFC v2 01/22] cpuset: fix isolcpus stay in root when isolated partition changes to root
From: Chen Ridong
Date: Sat Oct 25 2025 - 03:04:44 EST
From: Chen Ridong <chenridong@xxxxxxxxxx>
A bug was detected with the following steps:
# cd /sys/fs/cgroup/
# mkdir test
# echo 9 > test/cpuset.cpus
# echo isolated > test/cpuset.cpus.partition
# cat test/cpuset.cpus.partition
isolated
# cat test/cpuset.cpus
9
# echo root > test/cpuset.cpus.partition
# cat test/cpuset.cpus
9
# cat test/cpuset.cpus.partition
root
CPU 9 was initially listed in the "isolcpus" boot command line parameter.
When the partition type is changed from isolated to root, CPU 9 remains
in what becomes a valid root partition. This violates the rule that
isolcpus can only be assigned to isolated partitions.
Fix this by adding a housekeeping conflict check during transitions
between root and isolated partitions.
Fixes: 4a74e418881f ("cgroup/cpuset: Check partition conflict with housekeeping setup")
Signed-off-by: Chen Ridong <chenridong@xxxxxxxxxx>
---
kernel/cgroup/cpuset.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 96104710a649..6af4d80b53c4 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2995,6 +2995,8 @@ static int update_prstate(struct cpuset *cs, int new_prs)
* Need to update isolated_cpus.
*/
isolcpus_updated = true;
+ if (prstate_housekeeping_conflict(new_prs, cs->effective_xcpus))
+ err = PERR_HKEEPING;
} else {
/*
* Switching back to member is always allowed even if it
--
2.34.1