Bug 505837

Summary: cpuspeed daemon fails to start at boot time on system using p4-clockmod
Product: [Fedora] Fedora Reporter: Joachim Frieben <jfrieben>
Component: cpuspeedAssignee: Jarod Wilson <jarod>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: bajjisw, jarod, jfeeney, zenczykowski
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Fixed In Version: 1.5-10.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-02 05:53:21 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:

Description Joachim Frieben 2009-06-14 08:39:51 UTC
Description of problem:
Setting cpufreq governor from "GOVERNOR=" to "GOVERNOR=ondemand" in file /etc/sysconfig/cpuspeed has no effect on a system supporting "P4/Xeon(TM) CPU On-Demand Clock Modulation" after booting the system unless service "cpuspeed" is manually restarted.

Version-Release number of selected component (if applicable):
cpuspeed-1.5-6.fc11.i586

How reproducible:
Always.

Steps to Reproduce:
1. Set "GOVERNOR=ondemand" in file /etc/sysconfig/cpuspeed.
2. Restart system.
  
Actual results:
System remains at maximum frequency.

Expected results:
System modulates frequency dynamically.

Additional info:
- SMOLT hardware profile of affected system is available at
 http://smolt.fedoraproject.org/client/show_all/pub_ed9722d3-450a-4075-8c5b-7383b30227ec
- It actually seems that service cpuspeed is not started at all when the system boots up. After the system start-up has completed, one obtains:
    # chkconfig --list cpuspeed
    cpuspeed    0:Off  1:On  2:On  3:On  4:On  5:On  6:Off
    # service cpuspeed status
    p4-clockmod passive cooling is enabled
    # service cpuspeed start
    WARNING: Deprecated config file /etc/modprobe.conf, all config files
      belong into /etc/modprobe.d/.
    Enabling ondemand cpu frequency scaling:                   [  OK  ]
At this point, the CPU frequency actually is handled according to the config file prescribing policy "ondemand".

Comment 1 Joachim Frieben 2009-06-14 08:54:30 UTC
Loading module "p4-clockmod" manually at runlevel 1 or replacing "DRIVER=" by "DRIVER=p4-clockmod" in file /etc/sysconfig/cpuspeed allows cpuspeed to start up correctly and modulate the CPU frequency as expected without starting service "cpuspeed".
Since module "p4-clockmod" got loaded before, too, it got probably loaded at a later time than now, thus, too late for daemon "cpuspeed" to start up properly.

Comment 2 Jarod Wilson 2009-06-15 13:35:21 UTC
(In reply to comment #1)
> Loading module "p4-clockmod" manually at runlevel 1 or replacing "DRIVER=" by
> "DRIVER=p4-clockmod" in file /etc/sysconfig/cpuspeed allows cpuspeed to start
> up correctly

No, it actually allows it to start up INcorrectly. :)

Check out the initscript snippet:

      if [ ! -d ${cpu0freqd} -a "$cpu_vendor" == GenuineIntel ]; then
        # last-ditch effort for Intel proc boxes, try our neutered p4-clockmod
        # to get at least passive cooling support (no clock changes)
        /sbin/modprobe p4-clockmod 2> /dev/null
        if [ -d ${cpu0freqd} ]; then
          echo -n "Enabling p4-clockmod driver (passive cooling only): "
          success; echo
          return 0
        else
          /sbin/modprobe -r p4-clockmod 2> /dev/null
        fi
      fi

> and modulate the CPU frequency as expected without starting
> service "cpuspeed".

The p4-clockmod driver does NOT actually change processor frequency, it just twiddles with the clock and inserts idle waits. This subject has been beaten to death on a number of lists already. There's a link to some of the discussion in /etc/sysconfig/cpuspeed, iirc.

> Since module "p4-clockmod" got loaded before, too, it got probably loaded at a
> later time than now, thus, too late for daemon "cpuspeed" to start up properly.  

If you set "DRIVER=p4-clockmod", it bypasses the above snippet that bails after loading the module, and you go through to the governor setup portion. Something is definitely slightly off here, we ought to probably fall through if you set GOVERNOR by hand so you don't have to also set DRIVER, but ultimately, the default behavior is the intended behavior for p4-clockmod systems.

Comment 3 Jarod Wilson 2009-06-15 13:38:15 UTC
Whoops, link isn't there anymore, here it is:

http://lkml.org/lkml/2006/2/25/84

Basically, doing ondemand w/p4-clockmod actually wastes more power in typical usage, since there's no actual freq scaling, only throttling.

Comment 4 Joachim Frieben 2009-06-15 15:09:05 UTC
This has been discussed at length, right, and the p4-clockmod module was actually removed from the Fedora kernels for a while. However it has since been ressurrected, and thus, it is expected to be supported by cpuspeed.
Users who dislike this feature can simply switch off the cpuspeed service.

Comment 5 Jarod Wilson 2009-06-15 15:20:29 UTC
(In reply to comment #4)
> This has been discussed at length, right, and the p4-clockmod module was
> actually removed from the Fedora kernels for a while. However it has since been
> ressurrected, and thus, it is expected to be supported by cpuspeed.

No, its really not. Its expected to provide passive cooling only, as noted in the initscript.

Comment 6 Matthew Garrett 2009-06-15 16:36:08 UTC
Running ondemand with p4-clockmod introduces noticable latency on many systems and provides no power saving benefit. The default behaviour of not enabling it without user intervention is correct.

Comment 7 Jarod Wilson 2009-06-17 20:40:37 UTC
I've patched up the initscript so that only specifying governor in the config w/o a driver will let you do p4-clockmod + whatever governor, but we're going to stick with the current setup for the default case.

Comment 8 Fedora Update System 2009-06-18 04:27:40 UTC
cpuspeed-1.5-8.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/cpuspeed-1.5-8.fc11

Comment 9 Fedora Update System 2009-06-19 13:47:02 UTC
cpuspeed-1.5-8.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Joachim Frieben 2009-06-20 08:00:10 UTC
After uninstalling package cpuspeed, removing /etc/sysconfig/cpuspeed.rpmsave, installing cpuspeed-1.5-8.fc11, setting GOVERNOR to ONDEMAND and rebooting the system, the behaviour is exactly as before, namely the frequency remains the maximum frequency. Only after setting DRIVER to p4-clockmodm, too, and restarting service cpuspeed, frequency scaling is actually enabled.

Comment 11 Jarod Wilson 2009-06-22 12:28:02 UTC
Yeah, I screwed the pooch on that update... The test wasn't in the right place, and it wasn't actually entirely viable. Should have tested more. :\ Fixed fix coming in a sec.

Comment 12 Fedora Update System 2009-06-22 12:57:18 UTC
cpuspeed-1.5-9.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/cpuspeed-1.5-9.fc11

Comment 13 Joachim Frieben 2009-06-23 06:15:20 UTC
After uninstalling package cpuspeed, removing /etc/sysconfig/cpuspeed.rpmsave, installing cpuspeed-1.5-9.fc11, setting GOVERNOR to ONDEMAND and rebooting the system, the behaviour is exactly as before, namely the frequency remains the maximum frequency. Only after setting DRIVER to p4-clockmod, too, and restarting service cpuspeed, frequency scaling is actually enabled.

Comment 14 Jarod Wilson 2009-06-23 12:40:55 UTC
Okay, I officially fail. Before I push anything else out, I'm going to get an actual p4-clockmod system to test on...

Comment 15 Fedora Update System 2009-06-24 19:33:09 UTC
cpuspeed-1.5-9.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Jarod Wilson 2009-06-26 17:31:16 UTC
Please give cpuspeed-1.5-10.fc12 a spin, I've actually tested this time on a real live p4-clockmod system, and so far as I can tell, it now behaves as it was intended to ~3 revisions ago now. :)

Comment 17 Joachim Frieben 2009-06-29 06:49:37 UTC
cpuspeed-1.5-10.fc12 works correctly. It would be great to have an update for the F11 tree, too.

Comment 18 Fedora Update System 2009-06-30 18:57:52 UTC
cpuspeed-1.5-10.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/cpuspeed-1.5-10.fc11

Comment 19 Fedora Update System 2009-07-02 05:53:16 UTC
cpuspeed-1.5-10.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Jarod Wilson 2009-07-06 13:51:38 UTC
*** Bug 509754 has been marked as a duplicate of this bug. ***

Comment 21 bajji 2009-09-10 19:32:06 UTC
Any chance of getting a backport for fc10 ?

kernel:     2.6.27.30-170.2.82.fc10.i686 
cpuspeed:   1.5-2.fc10.i386

Thanks

Comment 22 Jarod Wilson 2009-09-29 15:22:42 UTC
(In reply to comment #21)
> Any chance of getting a backport for fc10 ?

Sure, why not. I'll throw it at updates-testing in a bit.

Comment 23 Fedora Update System 2009-09-29 15:35:05 UTC
cpuspeed-1.5-12.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/cpuspeed-1.5-12.fc10

Comment 24 Fedora Update System 2009-10-21 00:43:09 UTC
cpuspeed-1.5-12.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.