Bug 988731 - cpuspeed tries to read non-existent scaling_available_frequencies file and reports write error
cpuspeed tries to read non-existent scaling_available_frequencies file and re...
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cpuspeed (Show other bugs)
6.4
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: Petr Šabata
Red Hat Kernel QE team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-26 05:20 EDT by Michael Butow
Modified: 2013-07-26 07:14 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-26 07:14:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to avoid reading non-existent scaling_available_frequencies file (714 bytes, patch)
2013-07-26 05:28 EDT, Michael Butow
no flags Details | Diff

  None (edit)
Description Michael Butow 2013-07-26 05:20:50 EDT
Description of problem:
When 'cpuspeed' init script starts, it attempts to read non-existent file and reports write errors.
The file it is trying to read, /sys/devices/system/cpu/cpu<N>/cpufreq/scaling_available_frequencies, does not exist when the pcc-cpufreq driver is in operation.
That this file is not supposed to exist is documented in pcc-cpufreq.txt (see Additional Info), so it appears that the cpuspeed script is not handling this case appropriately.

There is no serious adverse effect from the malfunction, but the errors clutter up the logs.

Version-Release number of selected component (if applicable):
cpuspeed-1.5-19.el6.x86_64

How reproducible:
This is always reproducible on an HP Proliant DL380p Gen8 running RHEL6.4

Steps to Reproduce:
1. In /sys/devices/system/cpu/cpu0/cpufreq/ , ensure the file 'scaling_driver' contains 'pcc-cpufreq' and the file 'scaling_governor' contains 'ondemand'
2. Boot or restart 'cpuspeed' service
3. Observe error messages as below

Actual results:
myhost# /etc/init.d/cpuspeed restart
Disabling ondemand cpu frequency scaling:                  [  OK  ]
sed: can't read /sys/devices/system/cpu/cpu9/cpufreq/scaling_available_frequencies: No such file or directory
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
/etc/init.d/cpuspeed: line 91: echo: write error: Invalid argument
Enabling ondemand cpu frequency scaling:                   [  OK  ]

Expected results:
Disabling ondemand cpu frequency scaling:                  [  OK  ]
Enabling ondemand cpu frequency scaling:                   [  OK  ]

Additional info:
https://www.kernel.org/doc/Documentation/cpu-freq/pcc-cpufreq.txt
(refer section 2.1 - scaling_available_frequencies)
Comment 2 Michael Butow 2013-07-26 05:28:24 EDT
Created attachment 778720 [details]
Patch to avoid reading non-existent scaling_available_frequencies file

This is a simple patch which checks if the file exists before using it.
It gets rid of the errors on my system and does not change the end result (effective min/max frequencies).

It might be too simplistic for other systems.
Comment 3 Petr Šabata 2013-07-26 07:14:52 EDT
Yes, I'm aware of this issue.
We're switching to cpuinfo_max_freq in 6.5 which should be available on all platforms and is generally better for this task.

Still, thank you for the report.

Note You need to log in before you can comment on or make changes to this bug.