aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Di Stefano <luca.distefano@linaro.org>2019-09-17 11:35:23 +0000
committerLinaro Code Review <review@review.linaro.org>2019-09-17 11:35:23 +0000
commita676d44ab003cd69b1fc9998ea099b7d7cb9fbeb (patch)
tree5e72737a2c6fa4c2f4ddddb204c638e91b9cdcf5
parent96e2f0dcbfa81126831173a4bc6788edfaab2e19 (diff)
parent9ac732c0883bded548d83f9bc02e20328fe0593b (diff)
Merge "tcwg-tk1-cpucore: Make sure that docker has access to all CPU cores"HEADmaster
-rw-r--r--playbooks/roles/tcwg-tk1-cpucore/files/rc.local15
-rw-r--r--playbooks/roles/tcwg-tk1-cpucore/files/rc.local_llvm-tk1-0239
2 files changed, 48 insertions, 6 deletions
diff --git a/playbooks/roles/tcwg-tk1-cpucore/files/rc.local b/playbooks/roles/tcwg-tk1-cpucore/files/rc.local
index a55d5e8..b4749d7 100644
--- a/playbooks/roles/tcwg-tk1-cpucore/files/rc.local
+++ b/playbooks/roles/tcwg-tk1-cpucore/files/rc.local
@@ -11,18 +11,21 @@
#
# By default this script does nothing.
-trap "touch /tmp/rc_local_failed" EXIT
-
-rm -f /tmp/rc_local_failed
+rm -f /tmp/rc_local.log
+exec 1>/tmp/rc_local.log 2>&1
+set -x
+# Bring all CPUs online
echo 0 > /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
-for cpu in /sys/devices/system/cpu/cpu*; do
+for cpu in /sys/devices/system/cpu/cpu[0-3]; do
if [ x"$(cat $cpu/online)" = x"0" ]; then
echo 1 > $cpu/online
fi
done
-trap "" EXIT
+# Make sure docker containers are configured to use all CPUs.
+for cpuset in $(find /sys/fs/cgroup/cpuset/ -name cpuset.cpus); do
+ echo 0-3 > $cpuset
+done
exit 0
-
diff --git a/playbooks/roles/tcwg-tk1-cpucore/files/rc.local_llvm-tk1-02 b/playbooks/roles/tcwg-tk1-cpucore/files/rc.local_llvm-tk1-02
new file mode 100644
index 0000000..5819171
--- /dev/null
+++ b/playbooks/roles/tcwg-tk1-cpucore/files/rc.local_llvm-tk1-02
@@ -0,0 +1,39 @@
+#!/bin/sh -e
+#
+# rc.local
+#
+# This script is executed at the end of each multiuser runlevel.
+# Make sure that the script will "exit 0" on success or any other
+# value on error.
+#
+# In order to enable or disable this script just change the execution
+# bits.
+#
+# By default this script does nothing.
+
+rm -f /tmp/rc_local.log
+exec 1>/tmp/rc_local.log 2>&1
+set -x
+
+# Bring all CPUs online
+echo 0 > /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
+for cpu in /sys/devices/system/cpu/cpu[0-3]; do
+ if [ x"$(cat $cpu/online)" = x"0" ]; then
+ echo 1 > $cpu/online
+ fi
+done
+
+# Make sure docker containers are configured to use all CPUs.
+for cpuset in $(find /sys/fs/cgroup/cpuset/ -name cpuset.cpus); do
+ echo 0-3 > $cpuset
+done
+
+# We fix CPU frequency to 90% of the max.
+cpupower -c 0,1,2,3 frequency-set --governor performance --min 2116500 --max 2116500
+
+# Allow perf profiling
+sysctl kernel.kptr_restrict=0
+sysctl kernel.perf_event_mlock_kb=1024
+sysctl kernel.perf_event_paranoid=0
+
+exit 0