summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-05-22 12:52:19 +0530
committerFathi Boudra <fathi.boudra@linaro.org>2014-06-04 05:54:57 +0000
commit176ea92d674b4e701834102ec9f5d8b535490280 (patch)
tree24310b82e606ba9300666252ea186ee1ba6b9d0c
parentdd8925815ae7cc0640aaafc1516eb8e697855cc9 (diff)
is-cpu-isolated: Fix name of cpuset files
Based on configurations we may or may not have cpuset files names prefixed with "cpuset.". Get provision for this in our script so that it doesn't break for those platforms which have this prefixed. Change-Id: I8cf569d5bdd7f96ec3a86cb2aba3a767a3aa1bc1 Reported-by: Santosh Shukla <santosh.shukla@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rwxr-xr-xcommon/scripts/is-cpu-isolated.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh
index f12259d..ecbab7e 100755
--- a/common/scripts/is-cpu-isolated.sh
+++ b/common/scripts/is-cpu-isolated.sh
@@ -115,15 +115,19 @@ isolate_cpu() {
[ -d /dev/cpuset/gp ] || mkdir /dev/cpuset/gp
[ -d /dev/cpuset/rt ] || mkdir /dev/cpuset/rt
+ # check if platform needs a prefix for cpuset
+ [ -f /dev/cpuset/gp/cpus ] && CPUSET_PREFIX=""
+ [ -f /dev/cpuset/gp/cpuset.cpus ] && CPUSET_PREFIX="cpuset."
+
# Give same mems to both
- echo 0 > /dev/cpuset/gp/mems
- echo 0 > /dev/cpuset/rt/mems
+ echo 0 > /dev/cpuset/gp/$CPUSET_PREFIX"mems"
+ echo 0 > /dev/cpuset/rt/$CPUSET_PREFIX"mems"
# Setup the GP domain: CPU0
- echo $NON_ISOL_CPUS > /dev/cpuset/gp/cpus
+ echo $NON_ISOL_CPUS > /dev/cpuset/gp/$CPUSET_PREFIX"cpus"
# Setup the NOHZ domain: CPU1
- echo $ISOL_CPU > /dev/cpuset/rt/cpus
+ echo $ISOL_CPU > /dev/cpuset/rt/$CPUSET_PREFIX"cpus"
# Try to move all processes in top set to the GP set.
for pid in `cat /dev/cpuset/tasks`; do
@@ -141,13 +145,13 @@ isolate_cpu() {
echo 0 > /dev/cpuset/sched_load_balance
# Enable load balancing withing the GP domain
- echo 1 > /dev/cpuset/gp/sched_load_balance
+ echo 1 > /dev/cpuset/gp/$CPUSET_PREFIX"sched_load_balance"
# But disallow load balancing within the NOHZ domain
- echo 0 > /dev/cpuset/rt/sched_load_balance
+ echo 0 > /dev/cpuset/rt/$CPUSET_PREFIX"sched_load_balance"
# Quiesce CPU: i.e. migrate timers/hrtimers away
- echo 1 > /dev/cpuset/rt/quiesce
+ echo 1 > /dev/cpuset/rt/$CPUSET_PREFIX"quiesce"
stress -q --cpu $ISOL_CPU --timeout $STRESS_DURATION &
@@ -156,7 +160,7 @@ isolate_cpu() {
echo 1 > /sys/devices/system/cpu/cpu$ISOL_CPU/online
# Setup the NOHZ domain again: CPU1
- echo $ISOL_CPU > /dev/cpuset/rt/cpus
+ echo $ISOL_CPU > /dev/cpuset/rt/$CPUSET_PREFIX"cpus"
# Try to move all processes in top set to the GP set.
for pid in `ps h -C stress -o pid`; do