From 9c70b779ad91604dbfcfcde90c292797cb1ff352 Mon Sep 17 00:00:00 2001 From: "Francesco Poli (wintermute)" Date: Fri, 25 Apr 2025 17:07:31 +0200 Subject: [PATCH 1/5] cpupower: add a systemd service to run cpupower One of the most typical use cases of the 'cpupower' utility works as follows: run 'cpupower' at boot with the desired command-line options and then forget about it. Add a systemd service (disabled by default) that automates this use case (for environments where the initialization system is 'systemd'), by running 'cpupower' at boot with the settings read from a default configuration file. The systemd service, the associated support script and the corresponding default configuration file are derived from what is provided by the Arch Linux package (under "GPL-2.0-or-later" terms), modernized and enhanced in various ways (the script has also been checked with 'shellcheck'). Link: https://gitlab.archlinux.org/archlinux/packaging/packages/linux-tools/-/tree/dd2e2a311e05413d0d87a0346ffce8c7e98d6d2b Signed-off-by: Francesco Poli (wintermute) Reviewed-by: John B. Wyatt IV Reviewed-by: John B. Wyatt IV Tested-by: John B. Wyatt IV Tested-by: John B. Wyatt IV Signed-off-by: Shuah Khan --- tools/power/cpupower/Makefile | 15 +++++++++++++ tools/power/cpupower/README | 19 ++++++++++++++++ tools/power/cpupower/cpupower.default | 28 ++++++++++++++++++++++++ tools/power/cpupower/cpupower.service.in | 16 ++++++++++++++ tools/power/cpupower/cpupower.sh | 26 ++++++++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 tools/power/cpupower/cpupower.default create mode 100644 tools/power/cpupower/cpupower.service.in create mode 100644 tools/power/cpupower/cpupower.sh diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index 835123add0ed..9c2b5f71fee1 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile @@ -2,6 +2,7 @@ # Makefile for cpupower # # Copyright (C) 2005,2006 Dominik Brodowski +# Copyright (C) 2025 Francesco Poli # # Based largely on the Makefile for udev by: # @@ -71,6 +72,7 @@ bindir ?= /usr/bin sbindir ?= /usr/sbin mandir ?= /usr/man libdir ?= /usr/lib +libexecdir ?= /usr/libexec includedir ?= /usr/include localedir ?= /usr/share/locale docdir ?= /usr/share/doc/packages/cpupower @@ -83,6 +85,7 @@ CP = cp -fpR INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 +SETPERM_DATA = chmod 644 #bash completion scripts get sourced and so they should be rw only. INSTALL_SCRIPT = ${INSTALL} -m 644 @@ -302,6 +305,14 @@ install-tools: $(OUTPUT)cpupower $(INSTALL_PROGRAM) $(OUTPUT)cpupower $(DESTDIR)${bindir} $(INSTALL) -d $(DESTDIR)${bash_completion_dir} $(INSTALL_SCRIPT) cpupower-completion.sh '$(DESTDIR)${bash_completion_dir}/cpupower' + $(INSTALL) -d $(DESTDIR)${confdir}default + $(INSTALL_DATA) cpupower.default '$(DESTDIR)${confdir}default/cpupower' + $(INSTALL) -d $(DESTDIR)${libexecdir} + $(INSTALL_PROGRAM) cpupower.sh '$(DESTDIR)${libexecdir}/cpupower' + $(INSTALL) -d $(DESTDIR)${libdir}/systemd/system + sed 's|___CDIR___|$(DESTDIR)${confdir}|; s|___LDIR___|$(DESTDIR)${libexecdir}|' cpupower.service.in > '$(DESTDIR)${libdir}/systemd/system/cpupower.service' + $(SETPERM_DATA) '$(DESTDIR)${libdir}/systemd/system/cpupower.service' + if test -d /run/systemd/system; then systemctl daemon-reload; fi install-man: $(INSTALL_DATA) -D man/cpupower.1 $(DESTDIR)${mandir}/man1/cpupower.1 @@ -336,6 +347,9 @@ uninstall: - rm -f $(DESTDIR)${includedir}/cpufreq.h - rm -f $(DESTDIR)${includedir}/cpuidle.h - rm -f $(DESTDIR)${bindir}/utils/cpupower + - rm -f $(DESTDIR)${confdir}default/cpupower + - rm -f $(DESTDIR)${libexecdir}/cpupower + - rm -f $(DESTDIR)${libdir}/systemd/system/cpupower.service - rm -f $(DESTDIR)${mandir}/man1/cpupower.1 - rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-set.1 - rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-info.1 @@ -346,6 +360,7 @@ uninstall: - for HLANG in $(LANGUAGES); do \ rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \ done; + - if test -d /run/systemd/system; then systemctl daemon-reload; fi help: @echo 'Building targets:' diff --git a/tools/power/cpupower/README b/tools/power/cpupower/README index 2678ed81d311..e6ae7c1e0a0d 100644 --- a/tools/power/cpupower/README +++ b/tools/power/cpupower/README @@ -59,6 +59,10 @@ $ sudo make install ----------------------------------------------------------------------- | man pages | /usr/man | ----------------------------------------------------------------------- +| systemd service | /usr/lib | +----------------------------------------------------------------------- +| systemd support script | /usr/libexec | +----------------------------------------------------------------------- To put it in other words it makes build results available system-wide, enabling any user to simply start using it without any additional steps @@ -109,6 +113,10 @@ The files will be installed to the following dirs: ----------------------------------------------------------------------- | man pages | ${DESTDIR}/usr/man | ----------------------------------------------------------------------- +| systemd service | ${DESTDIR}/usr/lib | +----------------------------------------------------------------------- +| systemd support script | ${DESTDIR}/usr/libexec | +----------------------------------------------------------------------- If you look at the table for the default 'make' output dirs you will notice that the only difference with the non-default case is the @@ -173,6 +181,17 @@ The issue is that binary cannot find the 'libcpupower' library. So, we shall point to the lib dir: sudo LD_LIBRARY_PATH=lib64/ ./bin/cpupower +systemd service +--------------- + +A systemd service is also provided to run the cpupower utility at boot with +settings read from a configuration file. In order to enable this systemd +service, edit '${DESTDIR}/etc/default/cpupower' (uncommenting at least one of +the options, depending on your preferences) and then issue the following +command: + +$ sudo systemctl enable --now cpupower.service + THANKS ------ diff --git a/tools/power/cpupower/cpupower.default b/tools/power/cpupower/cpupower.default new file mode 100644 index 000000000000..376ca40fe5a6 --- /dev/null +++ b/tools/power/cpupower/cpupower.default @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2012, Sébastien Luttringer +# Copyright (C) 2024-2025, Francesco Poli + +# Default file for linux-cpupower + +# --- CPU clock frequency --- + +# Define CPU governor +# Valid governors: ondemand, performance, powersave, conservative, userspace +#GOVERNOR='ondemand' + +# Limit frequency range +# Valid suffixes: Hz, kHz (default), MHz, GHz, THz +#MIN_FREQ="2.25GHz" +#MAX_FREQ="3GHz" + +# Specific frequency to be set. +# Requires userspace governor to be available. +# If this option is set, all the previous frequency options are ignored +#FREQ= + +# --- CPU policy --- + +# Sets a register on supported Intel processore which allows software to convey +# its policy for the relative importance of performance versus energy savings to +# the processor. See man CPUPOWER-SET(1) for additional details +#PERF_BIAS= diff --git a/tools/power/cpupower/cpupower.service.in b/tools/power/cpupower/cpupower.service.in new file mode 100644 index 000000000000..f91eaed03872 --- /dev/null +++ b/tools/power/cpupower/cpupower.service.in @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2012-2020, Sébastien Luttringer +# Copyright (C) 2024, Francesco Poli + +[Unit] +Description=Apply cpupower configuration +ConditionVirtualization=!container + +[Service] +Type=oneshot +EnvironmentFile=-___CDIR___default/cpupower +ExecStart=___LDIR___/cpupower +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/tools/power/cpupower/cpupower.sh b/tools/power/cpupower/cpupower.sh new file mode 100644 index 000000000000..a37dd4cfdb2b --- /dev/null +++ b/tools/power/cpupower/cpupower.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2012, Sébastien Luttringer +# Copyright (C) 2024, Francesco Poli + +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 + +exit $ESTATUS From 99d2fce9b44dec6d270b85a7d28cdc99aaa93da6 Mon Sep 17 00:00:00 2001 From: "John B. Wyatt IV" Date: Tue, 29 Apr 2025 16:47:10 -0400 Subject: [PATCH 2/5] cpupower: change binding's makefile to use -lcpupower Originally I believed I needed the .o files to make the bindings. The linking failed due to a missing .so link in Fedora or by using make install-lib from the cpupower directory. Amend the makefile and the README. Big thanks to Wander Lairson Costa for the help. Link: https://lore.kernel.org/r/20250429204711.127274-1-jwyatt@redhat.com Signed-off-by: "John B. Wyatt IV" Signed-off-by: "John B. Wyatt IV" Signed-off-by: Shuah Khan --- tools/power/cpupower/bindings/python/Makefile | 8 +++----- tools/power/cpupower/bindings/python/README | 13 ++++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/power/cpupower/bindings/python/Makefile b/tools/power/cpupower/bindings/python/Makefile index 741f21477432..81db39a03efb 100644 --- a/tools/power/cpupower/bindings/python/Makefile +++ b/tools/power/cpupower/bindings/python/Makefile @@ -1,22 +1,20 @@ # SPDX-License-Identifier: GPL-2.0-only # Makefile for libcpupower's Python bindings # -# This Makefile expects you have already run the makefile for cpupower to build -# the .o files in the lib directory for the bindings to be created. +# This Makefile expects you have already run `make install-lib` in the lib +# directory for the bindings to be created. CC := gcc HAVE_SWIG := $(shell if which swig >/dev/null 2>&1; then echo 1; else echo 0; fi) HAVE_PYCONFIG := $(shell if which python-config >/dev/null 2>&1; then echo 1; else echo 0; fi) -LIB_DIR := ../../lib PY_INCLUDE = $(firstword $(shell python-config --includes)) -OBJECTS_LIB = $(wildcard $(LIB_DIR)/*.o) INSTALL_DIR = $(shell python3 -c "import site; print(site.getsitepackages()[0])") all: _raw_pylibcpupower.so _raw_pylibcpupower.so: raw_pylibcpupower_wrap.o - $(CC) -shared $(OBJECTS_LIB) raw_pylibcpupower_wrap.o -o _raw_pylibcpupower.so + $(CC) -shared -lcpupower raw_pylibcpupower_wrap.o -o _raw_pylibcpupower.so raw_pylibcpupower_wrap.o: raw_pylibcpupower_wrap.c $(CC) -fPIC -c raw_pylibcpupower_wrap.c $(PY_INCLUDE) diff --git a/tools/power/cpupower/bindings/python/README b/tools/power/cpupower/bindings/python/README index 952e2e02fd32..2a4896b648b7 100644 --- a/tools/power/cpupower/bindings/python/README +++ b/tools/power/cpupower/bindings/python/README @@ -5,18 +5,21 @@ libcpupower (aside from the libcpupower object files). requirements ------------ -* You need the object files in the libcpupower directory compiled by -cpupower's makefile. +* If you are building completely from upstream; please install libcpupower by +running `make install-lib` within the cpupower directory. This installs the +libcpupower.so file and symlinks needed. Otherwise, please make sure a symlink +to libcpupower.so exists in your library path from your distribution's +packages. * The SWIG program must be installed. -* The Python's development libraries installed. +* The Python's development libraries must be installed. Please check that your version of SWIG is compatible with the version of Python installed on your machine by checking the SWIG changelog on their website. https://swig.org/ Note that while SWIG itself is GPL v3+ licensed; the resulting output, -the bindings code: is permissively licensed + the license of libcpupower's .o -files. For these bindings that means GPL v2. +the bindings code: is permissively licensed + the license of libcpupower's +library files. For these bindings that means GPL v2. Please see https://swig.org/legal.html and the discussion [1] for more details. From 2a0eaa78ff4aa09d3a70f4bdcff13f5efe0f5861 Mon Sep 17 00:00:00 2001 From: "Francesco Poli (wintermute)" Date: Tue, 13 May 2025 18:29:31 +0200 Subject: [PATCH 3/5] cpupower: do not write DESTDIR to cpupower.service Fix the use of DESTDIR variable in the Makefile, as far as the installation of the systemd service unit 'cpupower.service' is concerned. This was caused by a misunderstanding about the purpose of the DESTDIR variable in the Makefile, which is instead meant to support staged installations: its value should not end up into installed file contents. Link: https://lore.kernel.org/linux-pm/20250509002206.bd2519ba52035d47c3c32aa6@paranoici.org/T/#mfbb938f9c0d5a21173acb92a061eb9205fd0abfe Link: https://www.gnu.org/prep/standards/html_node/DESTDIR.html Link: https://lore.kernel.org/r/20250513163937.61062-3-invernomuto@paranoici.org Fixes: 9c70b779ad91 ("cpupower: add a systemd service to run cpupower") Signed-off-by: Francesco Poli (wintermute) Signed-off-by: Shuah Khan --- tools/power/cpupower/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index 9c2b5f71fee1..4ad931509eaa 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile @@ -310,7 +310,7 @@ install-tools: $(OUTPUT)cpupower $(INSTALL) -d $(DESTDIR)${libexecdir} $(INSTALL_PROGRAM) cpupower.sh '$(DESTDIR)${libexecdir}/cpupower' $(INSTALL) -d $(DESTDIR)${libdir}/systemd/system - sed 's|___CDIR___|$(DESTDIR)${confdir}|; s|___LDIR___|$(DESTDIR)${libexecdir}|' cpupower.service.in > '$(DESTDIR)${libdir}/systemd/system/cpupower.service' + sed 's|___CDIR___|${confdir}|; s|___LDIR___|${libexecdir}|' cpupower.service.in > '$(DESTDIR)${libdir}/systemd/system/cpupower.service' $(SETPERM_DATA) '$(DESTDIR)${libdir}/systemd/system/cpupower.service' if test -d /run/systemd/system; then systemctl daemon-reload; fi From 4edef850a15c761039a50c119dbc8769b08ca45b Mon Sep 17 00:00:00 2001 From: "Francesco Poli (wintermute)" Date: Tue, 13 May 2025 18:29:32 +0200 Subject: [PATCH 4/5] cpupower: do not call systemctl at install time Fix the installation procedure for the systemd service unit 'cpupower.service'. Do not call "systemctl daemon-reload" in the Makefile, but explain when this command should be manually issued in the README file. Link: https://lore.kernel.org/linux-pm/20250509002206.bd2519ba52035d47c3c32aa6@paranoici.org/T/#mfbb938f9c0d5a21173acb92a061eb9205fd0abfe Link: https://lore.kernel.org/r/20250513163937.61062-4-invernomuto@paranoici.org Fixes: 9c70b779ad91 ("cpupower: add a systemd service to run cpupower") Signed-off-by: Francesco Poli (wintermute) Signed-off-by: Shuah Khan --- tools/power/cpupower/Makefile | 2 -- tools/power/cpupower/README | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index 4ad931509eaa..7cec2c30f98a 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile @@ -312,7 +312,6 @@ install-tools: $(OUTPUT)cpupower $(INSTALL) -d $(DESTDIR)${libdir}/systemd/system sed 's|___CDIR___|${confdir}|; s|___LDIR___|${libexecdir}|' cpupower.service.in > '$(DESTDIR)${libdir}/systemd/system/cpupower.service' $(SETPERM_DATA) '$(DESTDIR)${libdir}/systemd/system/cpupower.service' - if test -d /run/systemd/system; then systemctl daemon-reload; fi install-man: $(INSTALL_DATA) -D man/cpupower.1 $(DESTDIR)${mandir}/man1/cpupower.1 @@ -360,7 +359,6 @@ uninstall: - for HLANG in $(LANGUAGES); do \ rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \ done; - - if test -d /run/systemd/system; then systemctl daemon-reload; fi help: @echo 'Building targets:' diff --git a/tools/power/cpupower/README b/tools/power/cpupower/README index e6ae7c1e0a0d..494104de1540 100644 --- a/tools/power/cpupower/README +++ b/tools/power/cpupower/README @@ -59,7 +59,7 @@ $ sudo make install ----------------------------------------------------------------------- | man pages | /usr/man | ----------------------------------------------------------------------- -| systemd service | /usr/lib | +| systemd service | /usr/lib/systemd/system | ----------------------------------------------------------------------- | systemd support script | /usr/libexec | ----------------------------------------------------------------------- @@ -113,7 +113,7 @@ The files will be installed to the following dirs: ----------------------------------------------------------------------- | man pages | ${DESTDIR}/usr/man | ----------------------------------------------------------------------- -| systemd service | ${DESTDIR}/usr/lib | +| systemd service | ${DESTDIR}/usr/lib/systemd/system | ----------------------------------------------------------------------- | systemd support script | ${DESTDIR}/usr/libexec | ----------------------------------------------------------------------- @@ -185,11 +185,20 @@ systemd service --------------- A systemd service is also provided to run the cpupower utility at boot with -settings read from a configuration file. In order to enable this systemd -service, edit '${DESTDIR}/etc/default/cpupower' (uncommenting at least one of -the options, depending on your preferences) and then issue the following +settings read from a configuration file. + +If you want systemd to find the new service after the installation, the service +unit must have been installed in one of the system unit search path directories +(such as '/usr/lib/systemd/system/', which is the default location) and (unless +you are willing to wait for the next reboot) you need to issue the following command: +$ sudo systemctl daemon-reload + +If you want to enable this systemd service, edit +'${DESTDIR}/etc/default/cpupower' (uncommenting at least one of the options, +depending on your preferences) and then issue the following command: + $ sudo systemctl enable --now cpupower.service From e5174365c13246ed8fd2d40900edec37be6f7a34 Mon Sep 17 00:00:00 2001 From: "Francesco Poli (wintermute)" Date: Tue, 13 May 2025 18:29:33 +0200 Subject: [PATCH 5/5] cpupower: do not install files to /etc/default/ Improve the installation procedure for the systemd service unit 'cpupower.service', to be more distro-agnostic. Do not install the service unit configuration file to /etc/default/ (a directory that is used by Debian and Debian-derivatives and only rarely by other distros). Also, clarify the role of the configuration file in its own comments. Link: https://lore.kernel.org/linux-pm/20250509002206.bd2519ba52035d47c3c32aa6@paranoici.org/T/#ma8a3fa80acc4036af6c754e8ecabacc55b288ad1 Link: https://lore.kernel.org/r/20250513163937.61062-5-invernomuto@paranoici.org Fixes: 9c70b779ad91 ("cpupower: add a systemd service to run cpupower") Signed-off-by: Francesco Poli (wintermute) Signed-off-by: Shuah Khan --- tools/power/cpupower/Makefile | 6 +++--- tools/power/cpupower/README | 6 +++--- .../{cpupower.default => cpupower-service.conf} | 10 +++++++--- tools/power/cpupower/cpupower.service.in | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) rename tools/power/cpupower/{cpupower.default => cpupower-service.conf} (67%) diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index 7cec2c30f98a..be8dfac14076 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile @@ -305,8 +305,8 @@ install-tools: $(OUTPUT)cpupower $(INSTALL_PROGRAM) $(OUTPUT)cpupower $(DESTDIR)${bindir} $(INSTALL) -d $(DESTDIR)${bash_completion_dir} $(INSTALL_SCRIPT) cpupower-completion.sh '$(DESTDIR)${bash_completion_dir}/cpupower' - $(INSTALL) -d $(DESTDIR)${confdir}default - $(INSTALL_DATA) cpupower.default '$(DESTDIR)${confdir}default/cpupower' + $(INSTALL) -d $(DESTDIR)${confdir} + $(INSTALL_DATA) cpupower-service.conf '$(DESTDIR)${confdir}' $(INSTALL) -d $(DESTDIR)${libexecdir} $(INSTALL_PROGRAM) cpupower.sh '$(DESTDIR)${libexecdir}/cpupower' $(INSTALL) -d $(DESTDIR)${libdir}/systemd/system @@ -346,7 +346,7 @@ uninstall: - rm -f $(DESTDIR)${includedir}/cpufreq.h - rm -f $(DESTDIR)${includedir}/cpuidle.h - rm -f $(DESTDIR)${bindir}/utils/cpupower - - rm -f $(DESTDIR)${confdir}default/cpupower + - rm -f $(DESTDIR)${confdir}cpupower-service.conf - rm -f $(DESTDIR)${libexecdir}/cpupower - rm -f $(DESTDIR)${libdir}/systemd/system/cpupower.service - rm -f $(DESTDIR)${mandir}/man1/cpupower.1 diff --git a/tools/power/cpupower/README b/tools/power/cpupower/README index 494104de1540..9de449469568 100644 --- a/tools/power/cpupower/README +++ b/tools/power/cpupower/README @@ -195,9 +195,9 @@ command: $ sudo systemctl daemon-reload -If you want to enable this systemd service, edit -'${DESTDIR}/etc/default/cpupower' (uncommenting at least one of the options, -depending on your preferences) and then issue the following command: +If you want to enable this systemd service, edit '/etc/cpupower-service.conf' +(uncommenting at least one of the options, depending on your preferences) +and then issue the following command: $ sudo systemctl enable --now cpupower.service diff --git a/tools/power/cpupower/cpupower.default b/tools/power/cpupower/cpupower-service.conf similarity index 67% rename from tools/power/cpupower/cpupower.default rename to tools/power/cpupower/cpupower-service.conf index 376ca40fe5a6..02eabe8e3614 100644 --- a/tools/power/cpupower/cpupower.default +++ b/tools/power/cpupower/cpupower-service.conf @@ -2,7 +2,11 @@ # Copyright (C) 2012, Sébastien Luttringer # Copyright (C) 2024-2025, Francesco Poli -# Default file for linux-cpupower +# Configuration file for cpupower.service systemd service unit +# +# Edit this file (uncommenting at least one of the options, depending on +# your preferences) and then enable cpupower.service, if you want cpupower +# to run at boot with these settings. # --- CPU clock frequency --- @@ -15,14 +19,14 @@ #MIN_FREQ="2.25GHz" #MAX_FREQ="3GHz" -# Specific frequency to be set. +# Set a specific frequency # Requires userspace governor to be available. # If this option is set, all the previous frequency options are ignored #FREQ= # --- CPU policy --- -# Sets a register on supported Intel processore which allows software to convey +# Set a register on supported Intel processore which allows software to convey # its policy for the relative importance of performance versus energy savings to # the processor. See man CPUPOWER-SET(1) for additional details #PERF_BIAS= diff --git a/tools/power/cpupower/cpupower.service.in b/tools/power/cpupower/cpupower.service.in index f91eaed03872..fbd5b8c14270 100644 --- a/tools/power/cpupower/cpupower.service.in +++ b/tools/power/cpupower/cpupower.service.in @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (C) 2012-2020, Sébastien Luttringer -# Copyright (C) 2024, Francesco Poli +# Copyright (C) 2024-2025, Francesco Poli [Unit] Description=Apply cpupower configuration @@ -8,7 +8,7 @@ ConditionVirtualization=!container [Service] Type=oneshot -EnvironmentFile=-___CDIR___default/cpupower +EnvironmentFile=-___CDIR___cpupower-service.conf ExecStart=___LDIR___/cpupower RemainAfterExit=yes