summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-06-30 15:04:33 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2014-07-02 15:33:04 +0530
commit11c9bb5a3b60a7bcac7b82f0b2b8ed924d98187b (patch)
treea27c0d93e3fb669ed069398c0201228b406f29fd
parent2ea43f8fef6b8416a7b680f08c15c0ef6269c8f2 (diff)
is-cpu-isolated: Split out separate routine for cpufreq stuff
Change-Id: Iefcaf437dd59e8b9d314b4a168db589f877fa47e Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rwxr-xr-xcommon/scripts/is-cpu-isolated.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh
index 7984fb5..e713571 100755
--- a/common/scripts/is-cpu-isolated.sh
+++ b/common/scripts/is-cpu-isolated.sh
@@ -95,6 +95,22 @@ update_non_isol_cpus() {
isdebug echo ""
}
+# Get rid of cpufreq-timer activities, pass CPU number in $1
+cpufreq_fix_governor() {
+ # Remove governor's background timers, i.e. use performance governor
+ if [ -d /sys/devices/system/cpu/cpu$1/cpufreq ]; then
+ echo performance > /sys/devices/system/cpu/cpu$1/cpufreq/scaling_governor
+ fi
+}
+
+# Calls routine $1 for each Isolated CPU with parameter CPU-number
+for_each_isol_cpu() {
+ for i in `echo $ISOL_CPU | sed 's/,/ /g'`; do
+ $1 $i
+ done
+}
+
+
# routine to isolate a CPU
isolate_cpu() {
isdebug echo ""
@@ -111,10 +127,8 @@ isolate_cpu() {
exit 1
fi
- # Remove governor's background timers, i.e. use performance governor
- if [ -d /sys/devices/system/cpu/cpu$ISOL_CPU/cpufreq ]; then
- echo performance > /sys/devices/system/cpu/cpu$ISOL_CPU/cpufreq/scaling_governor
- fi
+ # Call cpufreq_fix_governor for each isolated CPU
+ for_each_isol_cpu cpufreq_fix_governor
# Affine all irqs to CPU0
for i in `find /proc/irq/* -name smp_affinity`; do