[Bug 1889668] Re: set-cpufreq error when cpu is offline
scottku
1889668 at bugs.launchpad.net
Thu Jul 30 17:42:36 UTC 2020
** Description changed:
- I have hyperthreading disabled on my Ubuntu 20.04 machine, which makes
+ I have hyperthreading disabled on my Ubuntu 19.10 machine, which makes
some processors in /sys/devices/system/cpu/cpu* have their "online" set
to 0.
However, when the for-loop in /lib/systemd/set-cpufreq iterates over the
processors, it doesn't check if the processor is online before trying to
write the governor name into scaling_governor.
+
+ The script appears to have the same bug in Ubuntu 20.04.
I modified the script to print the cpu it is trying to set before doing so, and I get the following:
Setting powersave scheduler for all CPUs
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu10/cpufreq/scaling_governor
/lib/systemd/set-cpufreq: 43: echo: echo: I/O error
Since the script doesn't continue to try other processors in the loop,
it means that only cpu0 and cpu1 on my machine get set to powersave and
the others remain with the performance governor. The cpufreq-info
command confirms this.
Checking if the processor has online==1 before writing, or putting the
echo within a "set +e" "set -e" pair would fix the problem (although the
latter approach would still print error messages).
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1889668
Title:
set-cpufreq error when cpu is offline
Status in systemd package in Ubuntu:
New
Bug description:
I have hyperthreading disabled on my Ubuntu 19.10 machine, which makes
some processors in /sys/devices/system/cpu/cpu* have their "online"
set to 0.
However, when the for-loop in /lib/systemd/set-cpufreq iterates over
the processors, it doesn't check if the processor is online before
trying to write the governor name into scaling_governor.
The script appears to have the same bug in Ubuntu 20.04.
I modified the script to print the cpu it is trying to set before doing so, and I get the following:
Setting powersave scheduler for all CPUs
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu10/cpufreq/scaling_governor
/lib/systemd/set-cpufreq: 43: echo: echo: I/O error
Since the script doesn't continue to try other processors in the loop,
it means that only cpu0 and cpu1 on my machine get set to powersave
and the others remain with the performance governor. The cpufreq-info
command confirms this.
Checking if the processor has online==1 before writing, or putting the
echo within a "set +e" "set -e" pair would fix the problem (although
the latter approach would still print error messages).
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1889668/+subscriptions
More information about the foundations-bugs
mailing list