Red Hat Bugzilla – Bug 181673
cpuspeed init script might check wrongly the /proc/acpi/processor/CPU0 file
Last modified: 2015-04-06 23:06:38 EDT
Description of problem:
Well, to start I must say I'm not really sure this is cpuspeed related nor that
this could be intentionally done, anyway here we go.
The init script from cpuspeed checks the throttling capabilities of the CPU with
the following line:
if [ -f /proc/acpi/processor/CPU0/throttling ];
it clearly assume that CPU0 is the right place to look into.
With kernel-2.6.15-1.1831_FC4 this is OK in case of single CPU systems (which is
the common case, I guess).
Unfortunately kernel-2.6.15-1.1831_FC4smp (at least with P4 HT), does not have
this directory, it has:
so it start to count (I dunno why) from 1 instead that from 0 (funny, because
the sys filesystem has cpu0 and cpu1...).
Clearly the init script cannot find "throttling" and so it assumes the
capability is not there.
As said before, this might be a kernel issue, nevertheless I guess that the
script should be somehow more careful in the file test.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Check the script
Check the /proc/acpi/processor/CPUx on a P4 HT with SMP kernel
(2.6.15-1.1831_FC4 at the time of writing).
The check fails and no throttling capability is detected.
The check should detect that the CPUs have throttling capability.
Actually the script works fine if the /etc/cpuspeed.conf set properly, with the
correct driver (p4-clockmod).
Bah, some ACPI BIOSes start counting CPUs at 0, and some at 1.
I'll fix this up by changing /etc/init.d/cpuspeed like so..
- thr=`head -n1
+ thr=`head -n1 -q
/proc/acpi/processor/CPU*/throttling | uniq`
That should take care of all cases.
Well, don't forget to change the "if" too... :-)
Maybe off topic: is there any plan to add an "automatic" module selection?
I mean, right now the user has to explicitly add (and know) the proper "driver"
in /etc/cpuspeed.conf, it would be really good to have it done automatically in
/etc/init.d/cpuspeed, or, like for lm_sensors, having a configuration tool,
which detects the proper driver and, somehow, configures the demon.
whoops, I missed the if, thanks for reminding me :)
long-term, I'd like this to 'just work', it's just finding the time to get the
necessary work done.
The init scripts should be able to figure out whats needed just by parsing
/proc/cpuinfo, but it's just not something I've got around to yet.
Maybe during FC6 development I'll find some time to look into it (and then
backport to older releases).
Closing bugs in MODIFIED state from prior Fedora releases. If this bug persists
in a current Fedora release (such as Fedora Core 5 or later), please reopen and
set the version appropriately.