[PATCH] cpupower: Add support for setting EPP via systemd service

Jan Kiszka posted 1 patch 1 month, 2 weeks ago
There is a newer version of this series
tools/power/cpupower/cpupower-service.conf | 5 +++++
tools/power/cpupower/cpupower.sh           | 6 ++++++
2 files changed, 11 insertions(+)
[PATCH] cpupower: Add support for setting EPP via systemd service
Posted by Jan Kiszka 1 month, 2 weeks ago
From: Jan Kiszka <jan.kiszka@siemens.com>

Extend the systemd service so that it can be used for tuning the Energy
Performance Preference (EPP) as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 tools/power/cpupower/cpupower-service.conf | 5 +++++
 tools/power/cpupower/cpupower.sh           | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/tools/power/cpupower/cpupower-service.conf b/tools/power/cpupower/cpupower-service.conf
index 02eabe8e3614..abbb46967565 100644
--- a/tools/power/cpupower/cpupower-service.conf
+++ b/tools/power/cpupower/cpupower-service.conf
@@ -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=
diff --git a/tools/power/cpupower/cpupower.sh b/tools/power/cpupower/cpupower.sh
index a37dd4cfdb2b..6283e8bf275d 100644
--- a/tools/power/cpupower/cpupower.sh
+++ b/tools/power/cpupower/cpupower.sh
@@ -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
-- 
2.47.3
Re: [PATCH] cpupower: Add support for setting EPP via systemd service
Posted by Shuah 1 month, 1 week ago
On 2/14/26 04:12, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Extend the systemd service so that it can be used for tuning the Energy
> Performance Preference (EPP) as well.

How would users use this support? Add a few lines to help them.

> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>   tools/power/cpupower/cpupower-service.conf | 5 +++++
>   tools/power/cpupower/cpupower.sh           | 6 ++++++
>   2 files changed, 11 insertions(+)
> 
> diff --git a/tools/power/cpupower/cpupower-service.conf b/tools/power/cpupower/cpupower-service.conf
> index 02eabe8e3614..abbb46967565 100644
> --- a/tools/power/cpupower/cpupower-service.conf
> +++ b/tools/power/cpupower/cpupower-service.conf
> @@ -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=
> diff --git a/tools/power/cpupower/cpupower.sh b/tools/power/cpupower/cpupower.sh
> index a37dd4cfdb2b..6283e8bf275d 100644
> --- a/tools/power/cpupower/cpupower.sh
> +++ b/tools/power/cpupower/cpupower.sh
> @@ -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

thanks,
-- Shuah
Re: [PATCH] cpupower: Add support for setting EPP via systemd service
Posted by Jan Kiszka 1 month, 1 week ago
On 20.02.26 17:19, Shuah wrote:
> On 2/14/26 04:12, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> Extend the systemd service so that it can be used for tuning the Energy
>> Performance Preference (EPP) as well.
> 
> How would users use this support? Add a few lines to help them.
> 

Just like the rest of this service: Install it, tune the conf file
according to local preferences. I just followed the preexisting patterns.

What would you like to see on top? And where? Copy what is inline
documented below into the commit message?

Jan

>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>>   tools/power/cpupower/cpupower-service.conf | 5 +++++
>>   tools/power/cpupower/cpupower.sh           | 6 ++++++
>>   2 files changed, 11 insertions(+)
>>
>> diff --git a/tools/power/cpupower/cpupower-service.conf b/tools/power/
>> cpupower/cpupower-service.conf
>> index 02eabe8e3614..abbb46967565 100644
>> --- a/tools/power/cpupower/cpupower-service.conf
>> +++ b/tools/power/cpupower/cpupower-service.conf
>> @@ -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=
>> diff --git a/tools/power/cpupower/cpupower.sh b/tools/power/cpupower/
>> cpupower.sh
>> index a37dd4cfdb2b..6283e8bf275d 100644
>> --- a/tools/power/cpupower/cpupower.sh
>> +++ b/tools/power/cpupower/cpupower.sh
>> @@ -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
> 
> thanks,
> -- Shuah

-- 
Siemens AG, Foundational Technologies
Linux Expert Center
Re: [PATCH] cpupower: Add support for setting EPP via systemd service
Posted by Shuah 1 month, 1 week ago
On 2/20/26 11:27, Jan Kiszka wrote:
> On 20.02.26 17:19, Shuah wrote:
>> On 2/14/26 04:12, Jan Kiszka wrote:
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> Extend the systemd service so that it can be used for tuning the Energy
>>> Performance Preference (EPP) as well.
>>
>> How would users use this support? Add a few lines to help them.
>>
> 
> Just like the rest of this service: Install it, tune the conf file
> according to local preferences. I just followed the preexisting patterns.
> 
> What would you like to see on top? And where? Copy what is inline
> documented below into the commit message?
> 

Yes. Copying what is inline into the commit message works well.

thanks,
-- Shuah