Re: [PATCH v2] cgroup/cpuset: Add test for partition root invalidation returning wrong CPUs

From
Waiman Long <longman@redhat.com>
Date
2026-08-11 18:34:15
Also in
linux-kselftest, lkml
Reply to
Shaojie Sun, 2026-08-11
On 8/11/26 5:58 AM, Shaojie Sun wrote:
quoted hunk ↗ jump to hunk
Add a test case to REMOTE_TEST_MATRIX covering the bug fixed by
commit 345f40166694 ("cgroup/cpuset: Return only actually allocated
CPUs during partition invalidation"). The test verifies that when a
sibling partition root changes its cpuset.cpus to overlap with another
partition root, only actually allocated CPUs (effective_xcpus) are
returned to the parent, not all CPUs in cpus_allowed.

Signed-off-by: Shaojie Sun <redacted>
---
  tools/testing/selftests/cgroup/test_cpuset_prs.sh | 6 ++++++
  1 file changed, 6 insertions(+)
diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
index 0d41aa0d343d..236cb1b38178 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -502,6 +502,12 @@ REMOTE_TEST_MATRIX=(
  	"  C1-4:P1   .   C1-2:P1  C1-3:P2  .       .  \
  	      .      .      P0     C2-3    .       .     p1:1,4|c11:1|c12:2-3 \
  							 p1:P1|c11:P0|c12:P2 2-3"
+	# Changing a sibling partition's cpuset.cpus to overlap with another
+	# sibling partition should invalidate itself and return only actually
+	# allocated CPUs (effective_xcpus) to the parent.
+	"  C1-4:P1   .   C1-2:P1  C2-4:P2  .       .  \
+	      .      .     .         C1-2  .       .     p1:3-4|c11:1-2|c12:3-4 \
+							 p1:P1|c11:P1|c12:P-2"
  )
  
  #
Reviewed-by: Waiman Long <longman@redhat.com>
Thread (5 messages) 5 messages, 3 authors, last reply 2026-08-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help