From 58d46f298f6a249e7fdae8eaca365b156ece9604 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Thu, 4 Jan 2018 10:54:11 -0700 Subject: [PATCH] scripts: Add reset option to prep_benchmarks.sh This undoes what it reasonably can. Change-Id: I83ff6d652fbf8b717432bef874003987fe87bfc6 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/393685 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu --- scripts/prep_benchmarks.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/prep_benchmarks.sh b/scripts/prep_benchmarks.sh index e84484fc9..408301144 100755 --- a/scripts/prep_benchmarks.sh +++ b/scripts/prep_benchmarks.sh @@ -48,4 +48,26 @@ function configure_performance() { echo "Done" } -configure_performance +function reset_performance() { + echo -n "Placing all CPUs in powersave mode..." + for governor in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do + echo -n powersave > $governor + done + echo "Done" + + if [ -f "/sys/devices/system/cpu/intel_pstate/no_turbo" ]; then + echo -n "Enabling Turbo Boost..." + echo -n 0 > /sys/devices/system/cpu/intel_pstate/no_turbo + echo "Done" + fi + + echo -n "Enabling irqbalance service..." + service irqbalance start 2> /dev/null + echo "Done" +} + +if [ "$1" = "reset" ]; then + reset_performance +else + configure_performance +fi