Skip to contentSkip to conversation

cpupower: Add support for setting EPP via systemd service

PATCH Applied Jan Kiszka 2 participants 2 messages Feb 21 – Mar 3 CPU power monitoring

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH v2 1/1 cpupower: Add support for setting EPP via systemd service

From: Jan Kiszka <[email protected]>

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.

---

Changes in v2:
- improve commit message

 tools/power/cpupower/cpupower-service.conf | 5 +++++
 tools/power/cpupower/cpupower.sh           | 6 ++++++
 2 files changed, 11 insertions(+)
tools/power/cpupower/cpupower-service.conf +5 -0
index 02eabe8e3614..abbb46967565 100644
@@ -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=
tools/power/cpupower/cpupower.sh +6 -0
index a37dd4cfdb2b..6283e8bf275d 100644
@@ -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
Signature · 1 line
2.47.3
maintainer Applied
#1 lore raw
Quoted 7 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

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.

Quoted 6 lines

---

Changes in v2:
- improve commit message

Applied to https://web.git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/log/?h=cpupower
for my next pull request to Rafael.

thanks,
-- Shuah