mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-28 15:47:16 -04:00
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>
33 lines
768 B
Bash
33 lines
768 B
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
# Copyright (C) 2012, Sébastien Luttringer
|
|
# Copyright (C) 2024, Francesco Poli <invernomuto@paranoici.org>
|
|
|
|
ESTATUS=0
|
|
|
|
# apply CPU clock frequency options
|
|
if test -n "$FREQ"
|
|
then
|
|
cpupower frequency-set -f "$FREQ" > /dev/null || ESTATUS=1
|
|
elif test -n "${GOVERNOR}${MIN_FREQ}${MAX_FREQ}"
|
|
then
|
|
cpupower frequency-set \
|
|
${GOVERNOR:+ -g "$GOVERNOR"} \
|
|
${MIN_FREQ:+ -d "$MIN_FREQ"} ${MAX_FREQ:+ -u "$MAX_FREQ"} \
|
|
> /dev/null || ESTATUS=1
|
|
fi
|
|
|
|
# apply CPU policy options
|
|
if test -n "$PERF_BIAS"
|
|
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
|