Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #83072 > unrolled thread

Bug#894906: linux-cpupower: provide a systemd service and a default config file

Started byjim_p <pitsiorisj@outlook.com>
First post2024-07-18 11:40 +0200
Last post2024-07-19 20:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.debian.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Bug#894906: linux-cpupower: provide a systemd service and a default config file jim_p <pitsiorisj@outlook.com> - 2024-07-18 11:40 +0200
    Bug#894906: linux-cpupower: provide a systemd service and a default config file Francesco Poli <invernomuto@paranoici.org> - 2024-07-19 20:30 +0200

#83072 — Bug#894906: linux-cpupower: provide a systemd service and a default config file

Fromjim_p <pitsiorisj@outlook.com>
Date2024-07-18 11:40 +0200
SubjectBug#894906: linux-cpupower: provide a systemd service and a default config file
Message-ID<J1vMe-2WA9-5@gated-at.bofh.it>
Package: linux-cpupower
Version: 6.9.8-1
Followup-For: Bug #894906
X-Debbugs-Cc: pitsiorisj@outlook.com

Hello everyone and thank you for your great work. I am a former user of the
obsolete cpufrequtils and of the unmaintained (by debian) cpupower-gui. I was
using those tools until 2021 to set my governor to powersave the summmer
months. Then I discovered linux-cpupower, which I used by running "cpupower
frequency-set -g powersave" on every boot.

I was also annoyed by the lack of a systemd service and a config file in
debian, until I tried the attached files here. I am having the following issue.
The service sometimes fails to start on boot. I added the -x parameter and
removed the "> /dev/null || ESTATUS=1" from line 20 of /usr/libexec/cpupower so
as to get a better error output, but all I get is this

$ sudo journalctl -b -u cpupower.service
Jul 14 19:50:41 pc systemd[1]: Starting cpupower.service - Apply cpupower
configuration...
Jul 14 19:50:41 pc cpupower[337]: + ESTATUS=0
Jul 14 19:50:41 pc cpupower[337]: + test  !=
Jul 14 19:50:41 pc cpupower[337]: + PARS= -g powersave
Jul 14 19:50:41 pc cpupower[337]: + PARS= -g powersave
Jul 14 19:50:41 pc cpupower[337]: + test  -g powersave !=
Jul 14 19:50:41 pc cpupower[337]: + cpupower frequency-set -g powersave
Jul 14 19:50:41 pc cpupower[343]: Setting cpu: 0
Jul 14 19:50:41 pc cpupower[343]: Error setting new values. Common errors:
Jul 14 19:50:41 pc cpupower[343]: - Do you have proper administration rights?
(super-user?)
Jul 14 19:50:41 pc cpupower[343]: - Is the governor you requested available and
modprobed?
Jul 14 19:50:41 pc cpupower[343]: - Trying to set an invalid policy?
Jul 14 19:50:41 pc cpupower[343]: - Trying to set a specific frequency, but
userspace governor is not available,
Jul 14 19:50:41 pc cpupower[343]:    for example because of hardware which
cannot be set to a specific frequency
Jul 14 19:50:41 pc cpupower[343]:    or because the userspace governor isn't
loaded?
Jul 14 19:50:41 pc cpupower[337]: + PARS=
Jul 14 19:50:41 pc cpupower[337]: + test  !=
Jul 14 19:50:41 pc cpupower[337]: + exit 0
Jul 14 19:50:41 pc systemd[1]: Finished cpupower.service - Apply cpupower
configuration.

Any ideas?


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.9.8-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages linux-cpupower depends on:
ii  libc6         2.38-14
ii  libcap2       1:2.66-5
ii  libcpupower1  6.9.8-1
ii  libpci3       1:3.13.0-1

linux-cpupower recommends no packages.

linux-cpupower suggests no packages.

-- no debconf information

[toc] | [next] | [standalone]


#83120

FromFrancesco Poli <invernomuto@paranoici.org>
Date2024-07-19 20:30 +0200
Message-ID<J20wF-3fBO-5@gated-at.bofh.it>
In reply to#83072

[Multipart message — attachments visible in raw view] — view raw

On Thu, 18 Jul 2024 12:31:59 +0300 jim_p <pitsiorisj@outlook.com> wrote:

[...]
> Then I discovered linux-cpupower, which I used by running "cpupower
> frequency-set -g powersave" on every boot.

Hi!

How did you use to run "cpupower frequency-set -g powersave" ?
Manually?
Or did you drop that line in some script executed at boot (such as the
deprecated rc.local)?

If I understand correctly, it was working, without failing, when you
followed this strategy.

> 
> I was also annoyed by the lack of a systemd service and a config file in
> debian, until I tried the attached files here.

Thanks for testing them!   :-)

> I am having the following issue.
> The service sometimes fails to start on boot.

What do you mean by "sometimes"?
Do you mean that it works on some boots and fails on some other boots,
in a seemingly unpredictable manner?
Or did you identify some pattern in these success/error cases?

> I added the -x parameter and
> removed the "> /dev/null || ESTATUS=1" from line 20 of /usr/libexec/cpupower so
> as to get a better error output, but all I get is this
> 
> $ sudo journalctl -b -u cpupower.service
> Jul 14 19:50:41 pc systemd[1]: Starting cpupower.service - Apply cpupower
> configuration...
> Jul 14 19:50:41 pc cpupower[337]: + ESTATUS=0
> Jul 14 19:50:41 pc cpupower[337]: + test  !=
> Jul 14 19:50:41 pc cpupower[337]: + PARS= -g powersave
> Jul 14 19:50:41 pc cpupower[337]: + PARS= -g powersave
> Jul 14 19:50:41 pc cpupower[337]: + test  -g powersave !=
> Jul 14 19:50:41 pc cpupower[337]: + cpupower frequency-set -g powersave
> Jul 14 19:50:41 pc cpupower[343]: Setting cpu: 0
> Jul 14 19:50:41 pc cpupower[343]: Error setting new values. Common errors:
> Jul 14 19:50:41 pc cpupower[343]: - Do you have proper administration rights?
> (super-user?)
> Jul 14 19:50:41 pc cpupower[343]: - Is the governor you requested available and
> modprobed?
> Jul 14 19:50:41 pc cpupower[343]: - Trying to set an invalid policy?
> Jul 14 19:50:41 pc cpupower[343]: - Trying to set a specific frequency, but
> userspace governor is not available,
> Jul 14 19:50:41 pc cpupower[343]:    for example because of hardware which
> cannot be set to a specific frequency
> Jul 14 19:50:41 pc cpupower[343]:    or because the userspace governor isn't
> loaded?
> Jul 14 19:50:41 pc cpupower[337]: + PARS=
> Jul 14 19:50:41 pc cpupower[337]: + test  !=
> Jul 14 19:50:41 pc cpupower[337]: + exit 0
> Jul 14 19:50:41 pc systemd[1]: Finished cpupower.service - Apply cpupower
> configuration.
> 
> Any ideas?

Not many, unfortunately, at least on my side.

It works for me™, which, I acknowledge, doesn't mean much...

Of course you installed cpupower.service into /usr/lib/systemd/system/,
hence we can assume that systemd is executing the /usr/libexec/cpupower
script as root.
And anyway, it must be so, otherwise it would *always* fail...

Maybe the systemd service sometimes gets started too early in your
system, but I don't understand how it could be: as far as I can see,
cpupower only needs to be able to load kernel modules... so how can it
be too early?!?
People from the Debian Kernel Team will sure understand these things
much better than me: could someone please step in and share his/her
insight?

In the meanwhile, let's try to add

  After=systemd-modules-load.service

to the [Unit] section of cpupower.service, as in the attached file.

Or maybe

  After=remote-fs.target

?

Could you please test this modification and see whether it cures your
issue?



-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web