From 176ea92d674b4e701834102ec9f5d8b535490280 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Thu, 22 May 2014 12:52:19 +0530 Subject: 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 Signed-off-by: Viresh Kumar --- common/scripts/is-cpu-isolated.sh | 20 ++++++++++++-------- 1 file 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 -- cgit v1.2.3