Add support for speedshift (hardware p-states).

This commit is contained in:
Tom Alexander
2022-10-15 20:54:58 -04:00
parent c45e4cc3fa
commit f965a125e6
5 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
#!/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
epp=$((100 - perc))
sysctl -N dev.hwpstate_intel | grep -E 'dev.hwpstate_intel.[0-9]+.epp' | while read var; do
sysctl "$var=$epp"
done

View File

@@ -0,0 +1,2 @@
# Control each core individually
machdep.hwpstate_pkg_ctrl=0