]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpupower: Add support for setting EPP via systemd service
authorJan Kiszka <jan.kiszka@siemens.com>
Sat, 21 Feb 2026 06:21:55 +0000 (07:21 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 3 Mar 2026 18:07:06 +0000 (11:07 -0700)
Extend the systemd service so that it can be used for tuning the Energy
Performance Preference (EPP) as well. Available options can be read from
/sys/devices/system/cpu/cpufreq/policy0/energy_performance_available_preferences.
The desired one can then be set in cpupower-service.conf.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/power/cpupower/cpupower-service.conf
tools/power/cpupower/cpupower.sh

index 02eabe8e361425946357f2ac6a5cb84f1f1ebf30..abbb469675656adabdabcfb8aca54fc3086fbbf2 100644 (file)
@@ -30,3 +30,8 @@
 # its policy for the relative importance of performance versus energy savings to
 # the processor. See man CPUPOWER-SET(1) for additional details
 #PERF_BIAS=
+
+# Set the Energy Performance Preference
+# Available options can be read from
+# /sys/devices/system/cpu/cpufreq/policy0/energy_performance_available_preferences
+#EPP=
index a37dd4cfdb2b9de52fb01dceccff64bdf3d930f9..6283e8bf275d64b3c1af3b8de627fd80a1ceed70 100644 (file)
@@ -23,4 +23,10 @@ then
     cpupower set -b "$PERF_BIAS" > /dev/null || ESTATUS=1
 fi
 
+# apply Energy Performance Preference
+if test -n "$EPP"
+then
+    cpupower set -e "$EPP" > /dev/null || ESTATUS=1
+fi
+
 exit $ESTATUS