Skip to contentSkip to conversation

cgroup_regression_test.sh: Remove obselte test_5

PATCH New Yang Xu 3 participants 7 messages Sep 19, 2019 – Sep 23, 2019

lore
Share & tools
lore

Yang Xu

author
#0 lore raw

PATCH 1/1 cgroup_regression_test.sh: Remove obselte test_5

test_5 is a very old regresstion test and kernel code has been rewritten completely since 2.6. No user will use such old kernel code to test. So I think we can remove it.

---
 .../cgroup/cgroup_regression_test.sh          | 75 -------------------
 1 file changed, 75 deletions(-)

-------------------------
a discussion about it:
https://patchwork.ozlabs.org/patch/1113680/
-------------------------

testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0 -75
index e197f5d3f..a32ed172c 100755
@@ -232,81 +232,6 @@ test4()
 	tst_res TPASS "no lockdep BUG was found"
 }
 
-#---------------------------------------------------------------------------
-# Bug:    When mount cgroup fs and the fs was busy, root_count should not be
-#         decremented in cgroup_kill_sb()
-# Kernel: 2.6.29-rcX
-# Links:  https://openvz.org/pipermail/devel/2009-January/016345.html
-#         http://lkml.org/lkml/2009/1/28/190
-# Fix:    commit 839ec5452ebfd5905b9c69b20ceb640903a8ea1a
-#---------------------------------------------------------------------------
-test5()
-{
-	local mounted
-	local failing
-	local mntpoint
-
-	local lines=`cat /proc/cgroups | wc -l`
-	if [ $lines -le 2 ]; then
-		tst_res TCONF "require at least 2 cgroup subsystems"
-		return
-	fi
-
-	local subsys1=`tail -n 1 /proc/cgroups | awk '{ print $1 }'`
-	local subsys2=`tail -n 2 /proc/cgroups | head -1 | awk '{ print $1 }'`
-
-	# Accounting here for the fact that the chosen subsystems could
-	# have been already previously mounted at boot time: in such a
-	# case we must skip the initial co-mount step (which would
-	# fail anyway) and properly re-organize the $mntpoint and
-	# $failing params to be used in the following expected-to-fail
-	# mount action. Note that the subsysN name itself will be listed
-	# amongst mounts options.
-	get_cgroup_mountpoint $subsys1 >/dev/null && mounted=$subsys1
-	[ -z "$mounted" ] && get_cgroup_mountpoint $subsys2 >/dev/null && mounted=$subsys2
-	if [ -z "$mounted" ]; then
-		mntpoint=cgroup
-		failing=$subsys1
-		mount -t cgroup -o $subsys1,$subsys2 xxx $mntpoint/
-		if [ $? -ne 0 ]; then
-			tst_res TFAIL "mount $subsys1 and $subsys2 failed"
-			return
-		fi
-	else
-		# Use the pre-esistent mountpoint as $mntpoint and use a
-		# co-mount with $failing: this way the 2nd mount will
-		# also fail (as expected) in this 'mirrored' configuration.
-		mntpoint=$(get_cgroup_mountpoint $mounted)
-		failing=$subsys1,$subsys2
-	fi
-
-	# This 2nd mount has been properly configured to fail
-	mount -t cgroup -o $failing xxx $mntpoint/ 2> /dev/null
-	if [ $? -eq 0 ]; then
-		tst_res TFAIL "mount $failing should fail"
-		# Do NOT unmount pre-existent mountpoints...
-		[ -z "$mounted" ] && umount $mntpoint/
-		return
-	fi
-
-	mkdir $mntpoint/0
-	# Otherwise we can't attach task
-	if [ "$subsys1" = cpuset -o "$subsys2" = cpuset ]; then
-		echo 0 > $mntpoint/0/cpuset.cpus 2> /dev/null
-		echo 0 > $mntpoint/0/cpuset.mems 2> /dev/null
-	fi
-
-	sleep 100 &
-	echo $! > $mntpoint/0/tasks
-
-	kill -TERM $! > /dev/null
-	wait $! 2>/dev/null
-	rmdir $mntpoint/0
-	# Do NOT unmount pre-existent mountpoints...
-	[ -z "$mounted" ] && umount $mntpoint/
-	check_kernel_bug
-}
-
 #---------------------------------------------------------------------------
 # Bug:    There was a race between cgroup_clone and umount
 # Kernel: 2.6.24 - 2.6.28, 2.6.29-rcX
Signature · 1 line
2.18.1
#1 lore raw

PATCH 1/1 cgroup_regression_test.sh: Remove obselte test_5

Hi!

Quoted 3 lines

test_5 is a very old regresstion test and kernel code has been rewritten completely since 2.6. No user will use such old kernel code to test. So I think we can remove it.

Unfortunatelly we also have to renumber the tests and change TST_CNT otherwise the test library will attempt to run a function that is not present.

Quoted 104 lines
---
 .../cgroup/cgroup_regression_test.sh          | 75 -------------------
 1 file changed, 75 deletions(-)

-------------------------
a discussion about it:
https://patchwork.ozlabs.org/patch/1113680/
-------------------------

testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0 -75
index e197f5d3f..a32ed172c 100755
@@ -232,81 +232,6 @@ test4()
 	tst_res TPASS "no lockdep BUG was found"
 }
 
-#---------------------------------------------------------------------------
-# Bug:    When mount cgroup fs and the fs was busy, root_count should not be
-#         decremented in cgroup_kill_sb()
-# Kernel: 2.6.29-rcX
-# Links:  https://openvz.org/pipermail/devel/2009-January/016345.html
-#         http://lkml.org/lkml/2009/1/28/190
-# Fix:    commit 839ec5452ebfd5905b9c69b20ceb640903a8ea1a
-#---------------------------------------------------------------------------
-test5()
-{
-	local mounted
-	local failing
-	local mntpoint
-
-	local lines=`cat /proc/cgroups | wc -l`
-	if [ $lines -le 2 ]; then
-		tst_res TCONF "require at least 2 cgroup subsystems"
-		return
-	fi
-
-	local subsys1=`tail -n 1 /proc/cgroups | awk '{ print $1 }'`
-	local subsys2=`tail -n 2 /proc/cgroups | head -1 | awk '{ print $1 }'`
-
-	# Accounting here for the fact that the chosen subsystems could
-	# have been already previously mounted at boot time: in such a
-	# case we must skip the initial co-mount step (which would
-	# fail anyway) and properly re-organize the $mntpoint and
-	# $failing params to be used in the following expected-to-fail
-	# mount action. Note that the subsysN name itself will be listed
-	# amongst mounts options.
-	get_cgroup_mountpoint $subsys1 >/dev/null && mounted=$subsys1
-	[ -z "$mounted" ] && get_cgroup_mountpoint $subsys2 >/dev/null && mounted=$subsys2
-	if [ -z "$mounted" ]; then
-		mntpoint=cgroup
-		failing=$subsys1
-		mount -t cgroup -o $subsys1,$subsys2 xxx $mntpoint/
-		if [ $? -ne 0 ]; then
-			tst_res TFAIL "mount $subsys1 and $subsys2 failed"
-			return
-		fi
-	else
-		# Use the pre-esistent mountpoint as $mntpoint and use a
-		# co-mount with $failing: this way the 2nd mount will
-		# also fail (as expected) in this 'mirrored' configuration.
-		mntpoint=$(get_cgroup_mountpoint $mounted)
-		failing=$subsys1,$subsys2
-	fi
-
-	# This 2nd mount has been properly configured to fail
-	mount -t cgroup -o $failing xxx $mntpoint/ 2> /dev/null
-	if [ $? -eq 0 ]; then
-		tst_res TFAIL "mount $failing should fail"
-		# Do NOT unmount pre-existent mountpoints...
-		[ -z "$mounted" ] && umount $mntpoint/
-		return
-	fi
-
-	mkdir $mntpoint/0
-	# Otherwise we can't attach task
-	if [ "$subsys1" = cpuset -o "$subsys2" = cpuset ]; then
-		echo 0 > $mntpoint/0/cpuset.cpus 2> /dev/null
-		echo 0 > $mntpoint/0/cpuset.mems 2> /dev/null
-	fi
-
-	sleep 100 &
-	echo $! > $mntpoint/0/tasks
-
-	kill -TERM $! > /dev/null
-	wait $! 2>/dev/null
-	rmdir $mntpoint/0
-	# Do NOT unmount pre-existent mountpoints...
-	[ -z "$mounted" ] && umount $mntpoint/
-	check_kernel_bug
-}
-
 #---------------------------------------------------------------------------
 # Bug:    There was a race between cgroup_clone and umount
 # Kernel: 2.6.24 - 2.6.28, 2.6.29-rcX
Signature · 7 lines
2.18.1




-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 2 lines
Cyril Hrubis
[email protected]
author
#2 lore raw

PATCH 1/1 cgroup_regression_test.sh: Remove obselte test_5

Quoted 9 lines · Cyril Hrubis

Hi!

Quoted 3 lines

test_5 is a very old regresstion test and kernel code has been rewritten completely since 2.6. No user will use such old kernel code to test. So I think we can remove it.

Unfortunatelly we also have to renumber the tests and change TST_CNT otherwise the test library will attempt to run a function that is not present.

Oh, Sorry. I forgot it(I am not familiar with ltp shell test frame, I am going to read doc/test-writing-guidelines.txt). Also, I will send a v2 patch.

Quoted 105 lines
Quoted 104 lines
---
  .../cgroup/cgroup_regression_test.sh          | 75 -------------------
  1 file changed, 75 deletions(-)

-------------------------
a discussion about it:
https://patchwork.ozlabs.org/patch/1113680/
-------------------------

testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +0 -75
index e197f5d3f..a32ed172c 100755
@@ -232,81 +232,6 @@ test4()
  	tst_res TPASS "no lockdep BUG was found"
  }
 
-#---------------------------------------------------------------------------
-# Bug:    When mount cgroup fs and the fs was busy, root_count should not be
-#         decremented in cgroup_kill_sb()
-# Kernel: 2.6.29-rcX
-# Links:  https://openvz.org/pipermail/devel/2009-January/016345.html
-#         http://lkml.org/lkml/2009/1/28/190
-# Fix:    commit 839ec5452ebfd5905b9c69b20ceb640903a8ea1a
-#---------------------------------------------------------------------------
-test5()
-{
-	local mounted
-	local failing
-	local mntpoint
-
-	local lines=`cat /proc/cgroups | wc -l`
-	if [ $lines -le 2 ]; then
-		tst_res TCONF "require at least 2 cgroup subsystems"
-		return
-	fi
-
-	local subsys1=`tail -n 1 /proc/cgroups | awk '{ print $1 }'`
-	local subsys2=`tail -n 2 /proc/cgroups | head -1 | awk '{ print $1 }'`
-
-	# Accounting here for the fact that the chosen subsystems could
-	# have been already previously mounted at boot time: in such a
-	# case we must skip the initial co-mount step (which would
-	# fail anyway) and properly re-organize the $mntpoint and
-	# $failing params to be used in the following expected-to-fail
-	# mount action. Note that the subsysN name itself will be listed
-	# amongst mounts options.
-	get_cgroup_mountpoint $subsys1 >/dev/null && mounted=$subsys1
-	[ -z "$mounted" ] && get_cgroup_mountpoint $subsys2 >/dev/null && mounted=$subsys2
-	if [ -z "$mounted" ]; then
-		mntpoint=cgroup
-		failing=$subsys1
-		mount -t cgroup -o $subsys1,$subsys2 xxx $mntpoint/
-		if [ $? -ne 0 ]; then
-			tst_res TFAIL "mount $subsys1 and $subsys2 failed"
-			return
-		fi
-	else
-		# Use the pre-esistent mountpoint as $mntpoint and use a
-		# co-mount with $failing: this way the 2nd mount will
-		# also fail (as expected) in this 'mirrored' configuration.
-		mntpoint=$(get_cgroup_mountpoint $mounted)
-		failing=$subsys1,$subsys2
-	fi
-
-	# This 2nd mount has been properly configured to fail
-	mount -t cgroup -o $failing xxx $mntpoint/ 2> /dev/null
-	if [ $? -eq 0 ]; then
-		tst_res TFAIL "mount $failing should fail"
-		# Do NOT unmount pre-existent mountpoints...
-		[ -z "$mounted" ] && umount $mntpoint/
-		return
-	fi
-
-	mkdir $mntpoint/0
-	# Otherwise we can't attach task
-	if [ "$subsys1" = cpuset -o "$subsys2" = cpuset ]; then
-		echo 0 > $mntpoint/0/cpuset.cpus 2> /dev/null
-		echo 0 > $mntpoint/0/cpuset.mems 2> /dev/null
-	fi
-
-	sleep 100 &
-	echo $! > $mntpoint/0/tasks
-
-	kill -TERM $! > /dev/null
-	wait $! 2>/dev/null
-	rmdir $mntpoint/0
-	# Do NOT unmount pre-existent mountpoints...
-	[ -z "$mounted" ] && umount $mntpoint/
-	check_kernel_bug
-}
-
  #---------------------------------------------------------------------------
  # Bug:    There was a race between cgroup_clone and umount
  # Kernel: 2.6.24 - 2.6.28, 2.6.29-rcX
Signature · 7 lines
2.18.1




-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

PATCH v2 1/1 cgroup_regression_test.sh: Remove obselte test_5

In reply to Cyril Hrubis

test_5 is a very old regresstion test and kernel code has been rewritten completely since 2.6. No user will use such old kernel code to test. So I think we can remove it.

Also rename test10 as test5, modify TST_CNT.

---
 ...ssion_10_1.sh => cgroup_regression_5_1.sh} |   0
 ...ssion_10_2.sh => cgroup_regression_5_2.sh} |   0
 .../cgroup/cgroup_regression_test.sh          | 111 +++---------------
 3 files changed, 18 insertions(+), 93 deletions(-)
 rename testcases/kernel/controllers/cgroup/{cgroup_regression_10_1.sh => cgroup_regression_5_1.sh} (100%)
 rename testcases/kernel/controllers/cgroup/{cgroup_regression_10_2.sh => cgroup_regression_5_2.sh} (100%)
testcases/kernel/controllers/cgroup/cgroup_regression_5_1.sh renamed from testcases/kernel/controllers/cgroup/cgroup_regression_10_1.sh +0 -0
similarity index 100%
rename from testcases/kernel/controllers/cgroup/cgroup_regression_10_1.sh
rename to testcases/kernel/controllers/cgroup/cgroup_regression_5_1.sh
testcases/kernel/controllers/cgroup/cgroup_regression_5_2.sh renamed from testcases/kernel/controllers/cgroup/cgroup_regression_10_2.sh +0 -0
similarity index 100%
rename from testcases/kernel/controllers/cgroup/cgroup_regression_10_2.sh
rename to testcases/kernel/controllers/cgroup/cgroup_regression_5_2.sh
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +18 -93

132 lines not on this page · raw message

Signature · 1 line
2.18.1
#4 lore raw

PATCH v2 1/1 cgroup_regression_test.sh: Remove obselte test_5

Hi Xu,

Quoted 5 lines

test_5 is a very old regresstion test and kernel code has been rewritten completely since 2.6. No user will use such old kernel code to test. So I think we can remove it.

Also rename test10 as test5, modify TST_CNT.

Merged, with additional note, why it's safe to remove it:

[ pvorel: test_5 is testing 839ec5452ebf ("cgroup: fix root_count when mount fails due to busy subsystem") from v2.6.29-rc4 which fixes e5f6a8609bab ("cgroups: make root_list contains active hierarchies only") from v2.6.24-rc1. While there are still people testing LTP on 2.6.x, nobody should be using -rc version now. ]

Kind regards,
Petr

author
#5 lore raw

PATCH v2 1/1 cgroup_regression_test.sh: Remove obselte test_5

Quoted 8 lines · Petr Vorel

Hi Xu,

Quoted 5 lines

test_5 is a very old regresstion test and kernel code has been rewritten completely since 2.6. No user will use such old kernel code to test. So I think we can remove it.

Also rename test10 as test5, modify TST_CNT.

Quoted 7 lines

Merged, with additional note, why it's safe to remove it:

[ pvorel: test_5 is testing 839ec5452ebf ("cgroup: fix root_count when mount fails due to busy subsystem") from v2.6.29-rc4 which fixes e5f6a8609bab ("cgroups: make root_list contains active hierarchies only") from v2.6.24-rc1. While there are still people testing LTP on 2.6.x, nobody should be using -rc version now. ]

I think your wrote v2.6.24-rc1 unexpectedly. commit e5f6a8609bab fixes the bug since v2.6.29-rc1 not v2.6.24-rc1. In addition to this typo, this reason looks good to me.

Quoted 5 lines

Kind regards,
Petr

#6 lore raw

PATCH v2 1/1 cgroup_regression_test.sh: Remove obselte test_5

Hi Xu,

Quoted 10 lines
Quoted 7 lines

Merged, with additional note, why it's safe to remove it:

[ pvorel: test_5 is testing 839ec5452ebf ("cgroup: fix root_count when mount fails due to busy subsystem") from v2.6.29-rc4 which fixes e5f6a8609bab ("cgroups: make root_list contains active hierarchies only") from v2.6.24-rc1. While there are still people testing LTP on 2.6.x, nobody should be using -rc version now. ]

I think your wrote v2.6.24-rc1 unexpectedly. commit e5f6a8609bab fixes the bug since v2.6.29-rc1 not v2.6.24-rc1. In addition to this typo, this reason looks good to me.

Thanks for info, unfortunately too late, git already has wrong kernel version in the commit message. Sorry for an error.

Kind regards,
Petr