From: Hang Zhengyang <hang.zhengyang1010@gmail.com>
To: Waiman Long <longman@redhat.com>,
Ridong Chen <ridong.chen@linux.dev>, Tejun Heo <tj@kernel.org>
Cc: "Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Shuah Khan" <shuah@kernel.org>,
cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] selftests/cgroup: Test partition switches after a sibling releases CPUs
Date: Thu, 3 Dec 2026 19:58:43 +0000 [thread overview]
Message-ID: <20261203195843.187930-3-hang.zhengyang1010@gmail.com> (raw)
In-Reply-To: <20261203195843.187930-1-hang.zhengyang1010@gmail.com>
Add two cases each to TEST_MATRIX and REMOTE_TEST_MATRIX. A sibling
releases its exclusive CPUs 3-4, then a partition with cpuset.cpus 2-5
is switched from root to isolated or back. It should take CPUs 3-4 from
its parent, which leaves CPU 1 to the member cpusets next to it.
Without the previous patch, the parent keeps CPUs 3-4 and the new cases
fail.
Signed-off-by: Hang Zhengyang <hang.zhengyang1010@gmail.com>
---
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
index 1397ec428c46..fb3d1440d1e8 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -440,6 +440,11 @@ TEST_MATRIX=(
" CX2-3:P1 . . C3 T:O2=0:O3=0:X . . X3 0 XA1:|XB1:3 A1:P-1"
" CX2-3:P1 X3 . C3 T:O2=0:O3=0:X . . X3 0 XA1:|XA2:|XB1:3 A1:P-1"
+ # Switching a partition between root and isolated after a sibling
+ # released its exclusive CPUs takes those CPUs from the parent.
+ " C1-4:X3-4 . . C2-5:P1 X . . P2 0 A1:1|B1:2-5 B1:P2 2-5"
+ " C1-4:X3-4 . . C2-5:P2 X . . P1 0 A1:1|B1:2-5 B1:P1 ."
+
# A child cannot recover until its exclusive CPUs are available again.
" CX1-4:P1 CX3-4:P1 . . X1-2 . . . 0 A1:1-2|A2:1-2|XA2: A1:P1|A2:P-1"
" CX1-4:P1 CX3-4:P1 . . X1-2:X1-4 . . . 0 A1:1-2|A2:3-4|XA2:3-4 A1:P1|A2:P1"
@@ -712,6 +717,15 @@ REMOTE_TEST_MATRIX=(
" CX2-3:T . C2-3:X2:P1 . . . \
. . X2-3 . . . p1:1,4-7|c11:2-3 \
p1:P0|c11:P1"
+ # Switching a remote partition between root and isolated after a
+ # sibling released its exclusive CPUs takes those CPUs from the top
+ # cpuset.
+ " CX1-5 . X3-4 C2-5:P1 . . \
+ . . X P2 . . p1:1|c11:1|c12:2-5 \
+ p1:P0|c11:P0|c12:P2 2-5"
+ " CX1-5 . X3-4 C2-5:P2 . . \
+ . . X P1 . . p1:1|c11:1|c12:2-5 \
+ p1:P0|c11:P0|c12:P1 ."
)
#
--
2.53.0
prev parent reply other threads:[~2026-12-03 19:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 19:58 [PATCH 0/2] cgroup/cpuset: Fix partition switch " Hang Zhengyang
2026-12-03 19:58 ` [PATCH 1/2] cgroup/cpuset: Update the parent when a partition switch adds CPUs Hang Zhengyang
2026-12-04 3:35 ` Ridong Chen
2026-12-03 19:58 ` Hang Zhengyang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203195843.187930-3-hang.zhengyang1010@gmail.com \
--to=hang.zhengyang1010@gmail.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mkoutny@suse.com \
--cc=ridong.chen@linux.dev \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®