diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-06-30 15:50:02 +0530 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2014-07-02 15:33:04 +0530 |
commit | 68a53c4aa58d1a6163185063a44f56f9e49015c8 (patch) | |
tree | d0279a2d687c331512e5abda2e757e138a02ac45 | |
parent | 11c9bb5a3b60a7bcac7b82f0b2b8ed924d98187b (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-x | common/scripts/is-cpu-isolated.sh | 39 |
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 |