Re: [PATCH-next v2 1/5] selftests/cgroup: Fix "test_cpuset_prs.sh -v" failures

From: Ridong Chen

Date: Tue Nov 10 2026 - 03:06:14 EST




On 11/10/2026 3:09 AM, Waiman Long wrote:
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: 362212853cd0 ("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 85e5b529d144..6074327c3477 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2164,12 +2164,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 32e1e44fa0b1..2d4744f2d6ac 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -540,16 +540,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 ."

The commit message still refers to commit 6e4834ba8986, which isn't in
next tree. It should be 362212853cd0 ?

I applied the whole series on top of next-20261109 and ran
test_cpuset_prs.sh with and without -v as well as test_cpuset on an
8-CPU VM. All tests passed and there is no warning in dmesg.


Reviewed-by: Ridong Chen <ridong.chen@xxxxxxxxx>
Tested-by: Ridong Chen <ridong.chen@xxxxxxxxx>

--
Best regards
Ridong