Add cpu_set_perf_perc on Linux.

This commit is contained in:
Tom Alexander
2023-03-25 09:21:43 -04:00
parent 347ffaea12
commit f1da60377e
4 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
#
# Tell speedshift whether to maximize CPU performance (100) or energy
# efficiency (0).
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
perc=$1
if [ $perc -lt 50 ]; then
echo "power" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
else
echo "performance" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
fi