diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-01-10 15:37:17 +0530 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2014-01-10 16:44:09 +0530 |
commit | 640b19ff82d8a2a1b05c723c8c96f7e2d3f20356 (patch) | |
tree | 6717339aebad7ab0869c557caa7a4d9dcb30f241 | |
parent | d40ea3b818751436d7253d5ac35d59d1a07f45b2 (diff) |
is-cpu-isolated: Move all tasks to CPU0 by hotunplugging CPU1
If we hot-unplug CPU1 and hotplug it back, then all tasks would be moved to CPU0
and that will let us have long isolation times. Actually this currently leads to
infinite isolation time.
Change-Id: I6ad0720328fa52f81491197d61ddb410ae31ee68
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rwxr-xr-x | common/scripts/is-cpu-isolated.sh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh index 0ff03cf..987d63b 100755 --- a/common/scripts/is-cpu-isolated.sh +++ b/common/scripts/is-cpu-isolated.sh @@ -186,10 +186,24 @@ isolate_cpu1() { # But disallow load balancing within the NOHZ domain echo 0 > /dev/cpuset/rt/sched_load_balance - # Start a single threaded task on CPU1 or RT group - echo $$ > /dev/cpuset/rt/tasks - stress -q --cpu 1 --timeout 2000 & - echo $$ > /dev/cpuset/gp/tasks + stress -q --cpu 1 --timeout 500 & + + # Restart CPU1 to migrate all tasks to CPU0 + echo 0 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu1/online + + # Setup the NOHZ domain again: CPU1 + echo 0 > /dev/cpuset/rt/mems + echo 1 > /dev/cpuset/rt/cpus + + # Try to move all processes in top set to the GP set. + for pid in `ps h -C stress -o pid`; do + echo $pid > /dev/cpuset/rt/tasks 2>/dev/null + if [ $? != 0 ]; then + isdebug echo -n "RT: Cannot move PID $pid: " + isdebug echo "$(cat /proc/$pid/status | grep ^Name | cut -f2)" + fi + done } clear_cpusets() { |