aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-02-02 17:05:02 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-02-02 17:05:02 +0100
commitbaf706eca875ebb623ff9c266658f6883a77e24a (patch)
tree638be5776e2b3e5de5fc266f4fbca92a307a7e1f
parentInitial scaffolding (diff)
downloadkbench9000-baf706eca875ebb623ff9c266658f6883a77e24a.tar.xz
kbench9000-baf706eca875ebb623ff9c266658f6883a77e24a.zip
Disable turbo during testsHEADmaster
-rwxr-xr-xrun.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/run.sh b/run.sh
index dfe5fb9..39c4719 100755
--- a/run.sh
+++ b/run.sh
@@ -8,9 +8,23 @@ nob_cpus() {
done
}
+noturbo() {
+ echo "[+] Setting no-turbo to status $1"
+ if [[ -e /sys/devices/system/cpu/intel_pstate/no_turbo ]]; then
+ echo "$1" > /sys/devices/system/cpu/intel_pstate/no_turbo
+ else
+ local val
+ [[ $1 == 0 ]] && val=0x850089
+ [[ $1 == 1 ]] && val=0x4000850089
+ [[ -n $val ]] || return 0
+ wrmsr -a 0x1a0 $val
+ fi
+}
+
[[ -e kbench9000.ko ]]
-trap "nob_cpus 1" INT TERM EXIT
+trap "nob_cpus 1; noturbo 0;" INT TERM EXIT
+noturbo 1
nob_cpus 0
echo "[+] Inserting module to run tests"