Commit 1bf33285 authored by Waiman Long's avatar Waiman Long Committed by Tejun Heo

cgroup/cpuset: Minor updates to test_cpuset_prs.sh

This patch makes the following minor updates to the cpuset partition
testing script test_cpuset_prs.sh.

 - Remove online_cpus function call as it will be called anyway on exit
   in cleanup.
 - Make the enabling of sched/verbose debugfs flag conditional on the
   "-v" verbose option and set DELAY_FACTOR to 2 in this case as cpuset
   partition operations are likely to be slowed down by enabling that.
Signed-off-by: default avatarWaiman Long <longman@redhat.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 6667439f
...@@ -15,13 +15,6 @@ skip_test() { ...@@ -15,13 +15,6 @@ skip_test() {
[[ $(id -u) -eq 0 ]] || skip_test "Test must be run as root!" [[ $(id -u) -eq 0 ]] || skip_test "Test must be run as root!"
# Set sched verbose flag, if available
if [[ -d /sys/kernel/debug/sched ]]
then
# Used to restore the original setting during cleanup
SCHED_DEBUG=$(cat /sys/kernel/debug/sched/verbose)
echo Y > /sys/kernel/debug/sched/verbose
fi
# Get wait_inotify location # Get wait_inotify location
WAIT_INOTIFY=$(cd $(dirname $0); pwd)/wait_inotify WAIT_INOTIFY=$(cd $(dirname $0); pwd)/wait_inotify
...@@ -37,10 +30,14 @@ CPUS=$(lscpu | grep "^CPU(s):" | sed -e "s/.*:[[:space:]]*//") ...@@ -37,10 +30,14 @@ CPUS=$(lscpu | grep "^CPU(s):" | sed -e "s/.*:[[:space:]]*//")
PROG=$1 PROG=$1
VERBOSE= VERBOSE=
DELAY_FACTOR=1 DELAY_FACTOR=1
SCHED_DEBUG=
while [[ "$1" = -* ]] while [[ "$1" = -* ]]
do do
case "$1" in case "$1" in
-v) VERBOSE=1 -v) VERBOSE=1
# Enable sched/verbose can slow thing down
[[ $DELAY_FACTOR -eq 1 ]] &&
DELAY_FACTOR=2
break break
;; ;;
-d) DELAY_FACTOR=$2 -d) DELAY_FACTOR=$2
...@@ -54,6 +51,14 @@ do ...@@ -54,6 +51,14 @@ do
shift shift
done done
# Set sched verbose flag if available when "-v" option is specified
if [[ -n "$VERBOSE" && -d /sys/kernel/debug/sched ]]
then
# Used to restore the original setting during cleanup
SCHED_DEBUG=$(cat /sys/kernel/debug/sched/verbose)
echo Y > /sys/kernel/debug/sched/verbose
fi
cd $CGROUP2 cd $CGROUP2
echo +cpuset > cgroup.subtree_control echo +cpuset > cgroup.subtree_control
[[ -d test ]] || mkdir test [[ -d test ]] || mkdir test
...@@ -65,6 +70,7 @@ cleanup() ...@@ -65,6 +70,7 @@ cleanup()
rmdir A1/A2/A3 A1/A2 A1 B1 > /dev/null 2>&1 rmdir A1/A2/A3 A1/A2 A1 B1 > /dev/null 2>&1
cd .. cd ..
rmdir test > /dev/null 2>&1 rmdir test > /dev/null 2>&1
[[ -n "$SCHED_DEBUG" ]] &&
echo "$SCHED_DEBUG" > /sys/kernel/debug/sched/verbose echo "$SCHED_DEBUG" > /sys/kernel/debug/sched/verbose
} }
...@@ -571,7 +577,6 @@ run_state_test() ...@@ -571,7 +577,6 @@ run_state_test()
echo "Test $TEST[$I] failed result check!" echo "Test $TEST[$I] failed result check!"
eval echo \"\${$TEST[$I]}\" eval echo \"\${$TEST[$I]}\"
dump_states dump_states
online_cpus
exit 1 exit 1
} }
...@@ -582,7 +587,6 @@ run_state_test() ...@@ -582,7 +587,6 @@ run_state_test()
eval echo \"\${$TEST[$I]}\" eval echo \"\${$TEST[$I]}\"
echo echo
dump_states dump_states
online_cpus
exit 1 exit 1
} }
} }
...@@ -594,7 +598,6 @@ run_state_test() ...@@ -594,7 +598,6 @@ run_state_test()
eval echo \"\${$TEST[$I]}\" eval echo \"\${$TEST[$I]}\"
echo echo
dump_states dump_states
online_cpus
exit 1 exit 1
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment