summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-06-30 14:26:14 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2014-07-02 15:33:05 +0530
commitf1e23b1b03d94ec0da684f98c399ce20a4d694c6 (patch)
tree2f522e4e4898222e3b7817c8b903cebd53847c93
parentc8d6063b4e4b5b9ff7d374972fa11c0121264ddf (diff)
is-cpu-isolated: Run --stress on the right CPU
Currently we were creating 'stress' on control plane CPU and then migrating it to data plane one. Instead create it on data plane CPU only. Change-Id: I63a38db978e211fada66eb4a646b51517519699f Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rwxr-xr-xcommon/scripts/is-cpu-isolated.sh18
1 files changed, 8 insertions, 10 deletions
diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh
index ac93ae4..51610b9 100755
--- a/common/scripts/is-cpu-isolated.sh
+++ b/common/scripts/is-cpu-isolated.sh
@@ -211,21 +211,19 @@ isolate_cpu() {
# Quiesce CPU: i.e. migrate timers/hrtimers away
echo 1 > /dev/cpuset/dplane/$CPUSET_PREFIX"quiesce"
- stress -q --cpu $ISOL_CPU --timeout $STRESS_DURATION &
-
# Restart $ISOL_CPU to migrate all tasks to CPU0
# Commented-out: as we should get good numbers without this HACK
#echo 0 > /sys/devices/system/cpu/cpu$ISOL_CPU/online
#echo 1 > /sys/devices/system/cpu/cpu$ISOL_CPU/online
- # Try to move all processes in top set to the cplane set.
- for pid in `ps h -C stress -o pid`; do
- echo $pid > /dev/cpuset/dplane/tasks 2>/dev/null
- if [ $? != 0 ]; then
- isdebug echo -n "dplane: Cannot move PID $pid: "
- isdebug echo "$(cat /proc/$pid/status | grep ^Name | cut -f2)"
- fi
- done
+ # Move shell to isolated CPU
+ echo $$ > /dev/cpuset/dplane/tasks
+
+ # Start single cpu bound stress thread
+ stress -q --cpu 1 --timeout $STRESS_DURATION &
+
+ # Move shell back to control plane CPU
+ echo $$ > /dev/cpuset/cplane/tasks
}
# routine to get CPU isolation time