Bug 616976

Summary: cpuspeed does not reset MIN/MAX values when config file is emptied
Product: Red Hat Enterprise Linux 6 Reporter: François Cami <contribs>
Component: cpuspeedAssignee: Petr Šabata <psabata>
Status: CLOSED ERRATA QA Contact: John Brier <jbrier>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: czhang, emcnabb, ovasik, psabata, qcai
Target Milestone: betaKeywords: Patch, RHELNAK
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cpuspeed-1.5-17.el6 Doc Type: Bug Fix
Doc Text:
Cause: The cpuspeed does not reset MIN/MAX values, when config file is emptied. Consequence: The MIN_SPEED or MAX_SPEED values weren't reset properly. Fix: Conditionals in init script were added to check these values. Result: The MIN_SPEED or MAX_SPEED values are reset properly.
Story Points: ---
Clone Of: 616507 Environment:
Last Closed: 2012-10-25 13:10:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 767187, 836169    
Attachments:
Description Flags
patch for /etc/init.d/cpuspeed none

Description François Cami 2010-07-21 20:58:01 UTC
+++ This bug was initially created as a clone of Bug #616507 +++

Created an attachment (id=433207)
patch for /etc/init.d/cpuspeed

Description of problem:
When MIN_SPEED (resp. MAX_SPEED) is set in /etc/sysconfig/cpuspeed, and then removed, /etc/init.d/cpuspeed does not reset the value to the CPU minimum (resp. maximum) frequency.

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

How reproducible:
Always

Steps to Reproduce:
0. check CPU frequency using cat /proc/cpuinfo
1. Set MIN_SPEED in /etc/sysconfig/cpuspeed to a suitable value superior to the CPU's minimum frequency
2. restart cpuspeed
3. Unset MIN_SPEED (restore configuration file)
4. restart cpuspeed
5. check CPU frequency using cat /proc/cpuinfo
  
Actual results:
CPU frequency in step 5 is equal to the MIN_SPEED set at step 1.

Expected results:
CPU frequency in steps 0 and 5 are identical.

Additional info:
This is because the cpuspeed script does not reset the values when the {MIN_SPEED,MAX_SPEED} variables are empty. A (crude) patch to do that is attached.

--- Additional comment from updates on 2010-07-21 08:11:29 EDT ---

cpuspeed-1.5-14.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/cpuspeed-1.5-14.fc13

--- Additional comment from psabata on 2010-07-21 08:18:13 EDT ---

Thank you for the patch.
This should now be fixed in 1:1.5-14 in both Fedora 13 and Rawhide.

Comment 1 François Cami 2010-07-21 20:58:56 UTC
Created attachment 433500 [details]
patch for /etc/init.d/cpuspeed

Comment 3 RHEL Program Management 2010-07-21 21:18:17 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 4 RHEL Program Management 2011-01-07 15:35:42 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 13 John Brier 2012-10-02 19:00:41 UTC
fyi, reproduced only while using ondemand, could not reproduce with userspace governor:

[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# grep MHz /proc/cpuinfo 
cpu MHz		: 1400.000
cpu MHz		: 1400.000
cpu MHz		: 1400.000
cpu MHz		: 1400.000

[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies 
3700000 3300000 2900000 2400000 1900000 1400000 
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# vim /etc/sysconfig/cpuspeed 
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# service cpuspeed restart
Disabling ondemand cpu frequency scaling:                  [  OK  ]
Enabling ondemand cpu frequency scaling:                   [  OK  ]
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# tail /var/log/messages
<snip unrelated messages>
Oct  2 13:02:50 server cpuspeed: Enabling userspace cpu frequency scaling governor
Oct  2 13:03:20 server cpuspeed: Enabling userspace cpu frequency scaling governor
Oct  2 14:43:06 server cpuspeed: Enabling ondemand cpu frequency scaling governor
Oct  2 14:43:06 server kernel: CPUFREQ: Per core ondemand sysfs interface is deprecated - ignore_nice_load
Oct  2 14:49:21 server cpuspeed: Disabling ondemand cpu frequency scaling governor
Oct  2 14:49:21 server cpuspeed: Enabling ondemand cpu frequency scaling governor
Oct  2 14:49:21 server kernel: CPUFREQ: Per core ondemand sysfs interface is deprecated - ignore_nice_load


[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# grep MHz /proc/cpuinfo 
cpu MHz		: 1900.000
cpu MHz		: 1900.000
cpu MHz		: 1900.000
cpu MHz		: 1900.000
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# vim /etc/sysconfig/cpuspeed 
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# service cpuspeed restart
Disabling ondemand cpu frequency scaling:                  [  OK  ]
Enabling ondemand cpu frequency scaling:                   [  OK  ]
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# vim /etc/sysconfig/cpuspeed 
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# !grep
grep MHz /proc/cpuinfo 
cpu MHz		: 1900.000
cpu MHz		: 1900.000
cpu MHz		: 1900.000
cpu MHz		: 1900.000
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# rpm -q cpuspeed
cpuspeed-1.5-15.el6.x86_64
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# grep _SPEED /etc/sysconfig/cpuspeed 
MAX_SPEED=
MIN_SPEED=
[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# 

VERIFIED:

[root@server cpuspeed-1.5-17.el6.x86_64.rpm-dir]# cd
[root@server ~]# rpm -Uvh cpuspeed-1.5-17.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:cpuspeed               ########################################### [100%]
[root@server ~]# vim /etc/sysconfig/cpuspeed 
[root@server ~]# !grep
grep _SPEED /etc/sysconfig/cpuspeed 
MAX_SPEED=
MIN_SPEED=
[root@server ~]# grep MHz /proc/cpuinfo 
cpu MHz		: 1900.000
cpu MHz		: 1900.000
cpu MHz		: 1900.000
cpu MHz		: 1900.000
[root@server ~]# service cpuspeed restart
Disabling ondemand cpu frequency scaling:                  [  OK  ]
Enabling ondemand cpu frequency scaling:                   [  OK  ]
[root@server ~]# grep MHz /proc/cpuinfo 
cpu MHz		: 1400.000
cpu MHz		: 1400.000
cpu MHz		: 1400.000
cpu MHz		: 1400.000
[root@server ~]#

Comment 16 errata-xmlrpc 2012-10-25 13:10:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-1404.html