From 1249e65db4c8dd11d336da2b0b277e6cf685be2a Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Fri, 10 Jan 2014 15:57:13 +0530 Subject: is-cpu-isolated.sh: Sense infinite isolation time With the latest updates we might end up with infinite isolation time and hence we need to sense it and quit/PASS tests rather than waiting infinitely. Change-Id: Id97be7ff566d7b31101b6a0ad19b450e218cc0a9 Signed-off-by: Viresh Kumar --- common/scripts/is-cpu-isolated.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh index 987d63b..91a2b3c 100755 --- a/common/scripts/is-cpu-isolated.sh +++ b/common/scripts/is-cpu-isolated.sh @@ -3,6 +3,7 @@ # Variable decided outcome of test, this is the minimum isolation we need. MIN_ISOLATION=10 RESULT="PASS" +STRESS_DURATION=500 if [ $2 ]; then MIN_ISOLATION=$2 @@ -49,6 +50,13 @@ get_isolation_duration() { while [ $new_count -eq $old_count ] do new_count=$(get_tick_count) + ps h -C stress -o pid > /dev/null + if [ $? != 0 ]; then + echo "Tick didn't got updated for stress duration:" $STRESS_DURATION + echo "Probably in infinite mode, quiting test" + echo "test_case_id:Min-isolation "$MIN_ISOLATION" secs result:"$RESULT" measurement:"$STRESS_DURATION" units:secs" + exit + fi done isdebug echo "count locked: " $new_count @@ -186,7 +194,7 @@ isolate_cpu1() { # But disallow load balancing within the NOHZ domain echo 0 > /dev/cpuset/rt/sched_load_balance - stress -q --cpu 1 --timeout 500 & + stress -q --cpu 1 --timeout $STRESS_DURATION & # Restart CPU1 to migrate all tasks to CPU0 echo 0 > /sys/devices/system/cpu/cpu1/online -- cgit v1.2.3