[PATCH 1/5] selftests/cgroup: Fix "test_cpuset_prs.sh -v" failures
From: Waiman Long
Date: Mon Nov 09 2026 - 11:10:13 EST
When the -v option is used to run test_cpuset_prs.sh, it activates the
use of sched-debug to determine the set of isolated CPUs which will
also consider 1-CPU partition as being isolated though they will not be
reflected in "cpuset.cpus.isolated". As a result, some of the expected
isolated CPUs values have 2 different set of values to correspond to
these two ways of determining isolated CPUs.
Commit 6e4834ba8986 ("cgroup/cpuset: Fix incorrect CPU accounting with
parent's effective_xcpus expansion") introduces some new test cases
which fail when the -v option is used. Update the test cases to make
them pass with the -v option as well.
Also remove an obsolete comment in update_parent_effective_cpumask()
of cpuset.c.
Reported-by: Tejun Heo <tj@xxxxxxxxxx>
Link: https://lore.kernel.org/lkml/886a562b52b1c5094142d547a8336457@xxxxxxxxxx
Fixes: 6e4834ba8986 ("cgroup/cpuset: Fix incorrect CPU accounting with parent's effective_xcpus expansion")
Signed-off-by: Waiman Long <longman@xxxxxxxxxx>
---
kernel/cgroup/cpuset.c | 6 ------
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 13 ++++++++-----
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 3052413e41e7..40e7d33847f7 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2157,12 +2157,6 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
else
part_error = PERR_NOTEXCL;
}
- /*
- * When both cs and parent remain valid, parent's
- * compute_partition_effective_cpumask() call would have removed
- * cs's effective_xcpus from the parent's effective_cpus. So
- * there is no need to adjust parent's effective_cpus here.
- */
}
write_error:
diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
index bdca6c471f87..3835b97f7a8b 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -534,16 +534,19 @@ TEST_MATRIX=(
# The extra CPUs gained by a child partition when its parent expands the
# exclusive CPUs have to be taken away from the parent.
- " C2-6:X2-5:P1 CX3-6:P1 \
- . . X2-6 . . . 0 A1:2|A2:3-6|XA2:3-6 A1:P1|A2:P1 ."
- " C2-6:X2-5:P1 CX3-6:P2 \
- . . X2-6 . . . 0 A1:2|A2:3-6|XA2:3-6 A1:P1|A2:P2 3-6"
+ " C2-6:X2-5:P1 CX4-6:P1 \
+ . . X2-6 . . . 0 A1:2-3|A2:4-6|XA2:4-6 \
+ A1:P1|A2:P1 ."
+ " C2-6:X2-5:P1 CX4-6:P2 \
+ . . X2-6 . . . 0 A1:2-3|A2:4-6|XA2:4-6 \
+ A1:P1|A2:P2 4-6"
# Both expansion and contraction of parent's effective_xcpus will be
# correctly handled in child partition and the child can be invalidated
# if a populated parent could lose all its effective_cpus.
" C2-6:X2-5:P1 CX3,5-6:P2 \
- . . X4-6 . . . 0 A1:4|A2:5-6|XA2:5-6 A1:P1|A2:P2 5-6"
+ . . X4-6 . . . 0 A1:4|A2:5-6|XA2:5-6 \
+ A1:P1|A2:P2 4-6|5-6"
" C2-6:X2-5:P1 CX3-6:P2 \
. . T:X4-6 . . . 0 A1:4-6|A2:4-6 A1:P1|A2:P-2 ."
--
2.56.0