summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-06-30 15:50:02 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2014-07-02 11:18:00 +0530
commitcbcf3c51ca381b9bd8a8afe81469b23ebac31b32 (patch)
treeef7f65b3a4e3fe1f8894834d40113cc2ee369b9f
parent43174bcb677b7f976dfe27768832af6857b14c87 (diff)
is-cpu-isolated: split out sysfs-related-tuning into a separate routine
Change-Id: Ic2dab8318e6c120ca4802a182e42399c695f4577 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rwxr-xr-xcommon/scripts/is-cpu-isolated.sh39
1 files changed, 23 insertions, 16 deletions
diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh
index e713571..e5458b0 100755
--- a/common/scripts/is-cpu-isolated.sh
+++ b/common/scripts/is-cpu-isolated.sh
@@ -111,22 +111,8 @@ for_each_isol_cpu() {
}
-# routine to isolate a CPU
-isolate_cpu() {
- isdebug echo ""
- isdebug echo "Started Isolating CPUs - via CPUSETS"
- isdebug echo "------------------------------------"
- isdebug echo ""
-
- # Update list of non isol CPUs
- update_non_isol_cpus
-
- # Check that we have cpusets enabled in the kernel
- if ! grep -q -s cpuset /proc/filesystems ; then
- echo "Error: Kernel is lacking support for cpuset!"
- exit 1
- fi
-
+# Update sysfs tunables to isolate CPU
+update_sysfs_tunables() {
# Call cpufreq_fix_governor for each isolated CPU
for_each_isol_cpu cpufreq_fix_governor
@@ -159,6 +145,27 @@ isolate_cpu() {
# Shutdown nmi watchdog as it uses perf events
sysctl -w kernel.watchdog=0
+}
+
+# routine to isolate a CPU
+isolate_cpu() {
+ isdebug echo ""
+ isdebug echo "Started Isolating CPUs - via CPUSETS"
+ isdebug echo "------------------------------------"
+ isdebug echo ""
+
+ # Update list of non isol CPUs
+ update_non_isol_cpus
+
+ # Update sysfs tunables
+ update_sysfs_tunables
+
+ # Check that we have cpusets enabled in the kernel
+ if ! grep -q -s cpuset /proc/filesystems ; then
+ echo "Error: Kernel is lacking support for cpuset!"
+ exit 1
+ fi
+
# make sure that the /dev/cpuset dir exits
# and mount the cpuset filesystem if needed
[ -d /dev/cpuset ] || mkdir /dev/cpuset