@@ -146,71 +146,6 @@ test_add_proc()
146146 echo $$ > $CGROUP2 /cgroup.procs # Move out the task
147147}
148148
149- #
150- # Testing the new "isolated" partition root type
151- #
152- test_isolated()
153- {
154- cd $CGROUP2 /test
155- echo 2 -3 > cpuset.cpus
156- TYPE=$(cat cpuset.cpus.partition)
157- [[ $TYPE = member ]] || echo member > cpuset.cpus.partition
158-
159- console_msg "Change from member to root"
160- test_partition root
161-
162- console_msg "Change from root to isolated"
163- test_partition isolated
164-
165- console_msg "Change from isolated to member"
166- test_partition member
167-
168- console_msg "Change from member to isolated"
169- test_partition isolated
170-
171- console_msg "Change from isolated to root"
172- test_partition root
173-
174- console_msg "Change from root to member"
175- test_partition member
176-
177- #
178- # Testing partition root with no cpu
179- #
180- console_msg "Distribute all cpus to child partition"
181- echo +cpuset > cgroup.subtree_control
182- test_partition root
183-
184- mkdir A1
185- cd A1
186- echo 2 -3 > cpuset.cpus
187- test_partition root
188- test_effective_cpus 2 -3
189- cd ..
190- test_effective_cpus ""
191-
192- console_msg "Moving task to partition test"
193- test_add_proc "No space left"
194- cd A1
195- test_add_proc ""
196- cd ..
197-
198- console_msg "Shrink and expand child partition"
199- cd A1
200- echo 2 > cpuset.cpus
201- cd ..
202- test_effective_cpus 3
203- cd A1
204- echo 2 -3 > cpuset.cpus
205- cd ..
206- test_effective_cpus ""
207-
208- # Cleaning up
209- console_msg "Cleaning up"
210- echo $$ > $CGROUP2 /cgroup.procs
211- [[ -d A1 ]] && rmdir A1
212- }
213-
214149#
215150# Cpuset controller state transition test matrix.
216151#
@@ -304,7 +239,7 @@ TEST_MATRIX=(
304239 A1 :P0 ,A2 :P2 ,A3 :P1 2 -4 "
305240 " C0 -4 :X2 -4 :S+ C1 -4 :X2 -4 :S+:P2 C2 -4 :X4 :P1 \
306241 . . X5 . . 0 A1 :0 -4 ,A2 :1 -4 ,A3 :2 -4 \
307- A1 :P0 ,A2 :P-2 ,A3 :P-1 . "
242+ A1 :P0 ,A2 :P-2 ,A3 :P-1 "
308243 " C0 -4 :X2 -4 :S+ C1 -4 :X2 -4 :S+:P2 C2 -4 :X4 :P1 \
309244 . . . X1 . 0 A1 :0 -1 ,A2 :2 -4 ,A3 :2 -4 \
310245 A1 :P0 ,A2 :P2 ,A3 :P-1 2 -4 "
@@ -347,10 +282,10 @@ TEST_MATRIX=(
347282 # cpus_allowed/exclusive_cpus update tests
348283 " C0 -3 :X2 -3 :S+ C1 -3 :X2 -3 :S+ C2 -3 :X2 -3 \
349284 . C4 . P2 . 0 A1 :4 ,A2 :4 ,XA2 :,XA3 :,A3 :4 \
350- A1 :P0 ,A3 :P-2 . "
285+ A1 :P0 ,A3 :P-2 "
351286 " C0 -3 :X2 -3 :S+ C1 -3 :X2 -3 :S+ C2 -3 :X2 -3 \
352287 . X1 . P2 . 0 A1 :0 -3 ,A2 :1 -3 ,XA1 :1 ,XA2 :,XA3 :,A3 :2 -3 \
353- A1 :P0 ,A3 :P-2 . "
288+ A1 :P0 ,A3 :P-2 "
354289 " C0 -3 :X2 -3 :S+ C1 -3 :X2 -3 :S+ C2 -3 :X2 -3 \
355290 . . C3 P2 . 0 A1 :0 -2 ,A2 :0 -2 ,XA2 :3 ,XA3 :3 ,A3 :3 \
356291 A1 :P0 ,A3 :P2 3 "
@@ -359,13 +294,13 @@ TEST_MATRIX=(
359294 A1 :P0 ,A3 :P2 3 "
360295 " C0 -3 :X2 -3 :S+ C1 -3 :X2 -3 :S+ C2 -3 :X2 -3 :P2 \
361296 . . X3 . . 0 A1 :0 -3 ,A2 :1 -3 ,XA2 :3 ,XA3 :3 ,A3 :2 -3 \
362- A1 :P0 ,A3 :P-2 . "
297+ A1 :P0 ,A3 :P-2 "
363298 " C0 -3 :X2 -3 :S+ C1 -3 :X2 -3 :S+ C2 -3 :X2 -3 :P2 \
364299 . . C3 . . 0 A1 :0 -3 ,A2 :3 ,XA2 :3 ,XA3 :3 ,A3 :3 \
365- A1 :P0 ,A3 :P-2 . "
300+ A1 :P0 ,A3 :P-2 "
366301 " C0 -3 :X2 -3 :S+ C1 -3 :X2 -3 :S+ C2 -3 :X2 -3 :P2 \
367302 . C4 . . . 0 A1 :4 ,A2 :4 ,A3 :4 ,XA1 :,XA2 :,XA3 \
368- A1 :P0 ,A3 :P-2 . "
303+ A1 :P0 ,A3 :P-2 "
369304
370305 # old-A1 old-A2 old-A3 old-B1 new-A1 new-A2 new-A3 new-B1 fail ECPUs Pstate ISOLCPUS
371306 # ------ ------ ------ ------ ------ ------ ------ ------ ---- ----- ------ --------
@@ -804,6 +739,71 @@ run_state_test()
804739 echo " All $I tests of $TEST PASSED."
805740}
806741
742+ #
743+ # Testing the new "isolated" partition root type
744+ #
745+ test_isolated ()
746+ {
747+ cd $CGROUP2 /test
748+ echo 2-3 > cpuset.cpus
749+ TYPE=$( cat cpuset.cpus.partition)
750+ [[ $TYPE = member ]] || echo member > cpuset.cpus.partition
751+
752+ console_msg " Change from member to root"
753+ test_partition root
754+
755+ console_msg " Change from root to isolated"
756+ test_partition isolated
757+
758+ console_msg " Change from isolated to member"
759+ test_partition member
760+
761+ console_msg " Change from member to isolated"
762+ test_partition isolated
763+
764+ console_msg " Change from isolated to root"
765+ test_partition root
766+
767+ console_msg " Change from root to member"
768+ test_partition member
769+
770+ #
771+ # Testing partition root with no cpu
772+ #
773+ console_msg " Distribute all cpus to child partition"
774+ echo +cpuset > cgroup.subtree_control
775+ test_partition root
776+
777+ mkdir A1
778+ cd A1
779+ echo 2-3 > cpuset.cpus
780+ test_partition root
781+ test_effective_cpus 2-3
782+ cd ..
783+ test_effective_cpus " "
784+
785+ console_msg " Moving task to partition test"
786+ test_add_proc " No space left"
787+ cd A1
788+ test_add_proc " "
789+ cd ..
790+
791+ console_msg " Shrink and expand child partition"
792+ cd A1
793+ echo 2 > cpuset.cpus
794+ cd ..
795+ test_effective_cpus 3
796+ cd A1
797+ echo 2-3 > cpuset.cpus
798+ cd ..
799+ test_effective_cpus " "
800+
801+ # Cleaning up
802+ console_msg " Cleaning up"
803+ echo $$ > $CGROUP2 /cgroup.procs
804+ [[ -d A1 ]] && rmdir A1
805+ }
806+
807807#
808808# Wait for inotify event for the given file and read it
809809# $1: cgroup file to wait for
0 commit comments