powernowd doesn't use /etc/default/powernowd anymore

Bug #67341 reported by Jens Berke
10
Affects Status Importance Assigned to Milestone
powernowd (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Clean install of Edgy Eft Release Candidate, powernowd version 0.97-1ubuntu6

I've set the option
OPTIONS="-q -m 2 -l 40 -u 90 -s 100000"
in /etc/default/powernowd in order to run powernowd in PASSIVE mode.

However, the behaviour I see is that the speedstepping is still done in AGRESSIVE mode. So I guess the file is ignored.

When I stop powernowd with
sudo /etc/init.d/powernowd stop

and start it again with
sudo powernowd -q -m 2 -l 40 -u 90 -s 100000

the speedstepping is done fine and complying to the options I provided.

However, starting it with
sudo /etc/init.d/powernowd start
results in the erroneous behaviour again.

This was working well on Dapper

Tags: patch

Related branches

Revision history for this message
Jens Berke (jensberke) wrote :

More info:

I controlled the speedstepping by running BOINC (http://climateprediction.net). After login or when I use
sudo /etc/init.d/powernowd start
the CPU goes up to highest speed as soon as the BOINC project starts running, and it stays there. Nice value of the process is 19.

When I stop and start powernowd like I wrote in my initial posting:
sudo powernowd -q -m 2 -l 40 -u 90 -s 100000
then the speedstepping is done in that mode and the CPU stays at low frequency when BOINC is running. The output is:

powernowd: verbosity:Settings:
powernowd: verbosity: 1
powernowd: mode: 2 (PASSIVE)
powernowd: step: 100 MHz (100000 kHz)
powernowd: lowwater: 40 %
powernowd: highwater: 90 %
powernowd: poll interval: 1000 ms
powernowd: Found 1 scalable unit: -- 1 'CPU' per scalable unit
powernowd: cpu0: 800Mhz - 1866Mhz (12 steps)
powernowd: step1 : 1866Mhz
powernowd: step2 : 1766Mhz
powernowd: step3 : 1666Mhz
powernowd: step4 : 1566Mhz
powernowd: step5 : 1466Mhz
powernowd: step6 : 1366Mhz
powernowd: step7 : 1266Mhz
powernowd: step8 : 1166Mhz
powernowd: step9 : 1066Mhz
powernowd: step10 : 966Mhz
powernowd: step11 : 866Mhz
powernowd: step12 : 800Mhz

If I just do
sudo powernowd
passing no parameters to it, the output is just

powernowd: Found 1 scalable unit: -- 1 'CPU' per scalable unit
powernowd: cpu0: 800Mhz - 1866Mhz (5 steps)

which looks like the AGRESSIVE mode and not the one I saved in /etc/default/powernowd. However, starting powernowd that way results in the CPU staying at lowest frequency as well when BOINC is running.

So, there are two issues actually:
1.
Options set in /etc/default/powernowd arent used at all, no matter how powernowd is started
2.
There's a difference in speedstepping behaviour, depending on the way powernowd is started:
  sudo /etc/init.d/powernowd start => nice value ignored
  sudo powernowd => nice value respected

Revision history for this message
Paul Sladen (sladen) wrote :

This is because of bug #13610 (use 'ondemand' kernel governor if possible).

When the kernel governor is used, then any options passed to powernowd (the userspace governor) are ignored and the daemon 'powernowd' is not actually started, only the kernel is updated.

Changed in powernowd:
importance: Undecided → Low
status: Unconfirmed → Confirmed
Revision history for this message
Justin Mason (jm-ubuntu) wrote :

I've just run into this bug, too, on my from-scratch install of Edgy on a Dell Inspiron 1300...

I similarly thought that powernowd should have been running, since I had the package installed; it took 10 minutes to figure out that the init script was silently exiting due to the "cpufreq_ondemand" module being loaded, instead of starting the daemon. This is bad behaviour.

The "ondemand" governor doesn't work well on this hardware, since it causes the fan to start up and shut down every couple of minutes or so, even when the machine is entirely idle (this is probably related to bug #93404). "powernowd" is the best userspace governor for the job, and the one I *want* to use; as it stands, I had to edit the init script to inhibit the "ondemand" code.

In essence, I agree with bug #94309. It is inappropriate to hook the "use ondemand if possible" code into the init script for an unrelated daemon, esp when that daemon is more suitable for certain hardware. A better fix would be to create a *new* package for that code, and keep the "powernowd" package for the powernowd daemon.

If that's too hard due to packaging policies as described in that bug, at the very least, expose the current behaviour, and a switch to fix it, in an /etc/default/powernowd file.

Revision history for this message
Tessa (unit3) wrote :

I'd agree with Justin's comments. I was just bitten by this setting up BOINC on my laptop, and suddenly have the CPU speed (and thus CPU fan speed) shoot through the roof because of BOINC's 95% idle usage. Clearly, this should not be intended behaviour for any power scheduler that something running at idle priority should cause it to raise the CPU speed, and this is doubly true on a laptop running off batteries.

In any case, I'm also in favour of having this behaviour at least be controllable from /etc/default/powernowd until bug #94309 is resolved.

Revision history for this message
pableu (ps-pableu) wrote :

I have also seen this behaviour on our mailserver running Ubuntu 7.04 Server. I just commented out the following part of /etc/init.d/powernowd (lines 108-112):

if use_ondemand
then
  log_end_msg 0
  return 0
fi

Seems to work for me, powernowd is running according to ps and frequency scaling behaves as i wish.

Revision history for this message
Daniel Hahler (blueyed) wrote :

This patch should fix this: if $OPTIONS are set in /etc/default/powernowd, the init script does not use the ondemand governor instead of starting powernowd.

Additionally, it activates the "ignore_nice_load" setting, which is the as powernowd does - unless you use the "-n" option, which would include the nice load.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Added reference to bug 60042 to changelog (which is about ignore_nice_load).

Daniel Hahler (blueyed)
Changed in powernowd:
status: Confirmed → In Progress
Revision history for this message
Daniel Hahler (blueyed) wrote :

Updated debdiff again, with more powernowd bugs fixed.

Please consider uploading it.

A PPA build is available for testing at https://launchpad.net/~blueyed/+archive/+index?field.name_filter=powernow

Changed in powernowd:
status: In Progress → Triaged
Revision history for this message
Daniel Hahler (blueyed) wrote :

Updated debdiff once more, with a clarification fix for debian/cpufreq-detect.sh (see bug 162524).

Revision history for this message
Daniel Hahler (blueyed) wrote :

Updated debdiff, adding a reference to bug 107820 to the changelog.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Updated debdiff, to match current version in Hardy.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Sorry, bug spam necessary because of bug 176085.

This bug has a patch attached, which needs review and sponsoring.

Revision history for this message
Steve Kowalik (stevenk) wrote :

powernowd (0.97-2ubuntu2) hardy; urgency=low

  [ dAniel hAhler ]
  * debian/init.d:
    - skip use_ondemand if $OPTIONS != "-q" are given (LP: #67341)
    - activate [...]/cpufreq/ondemand/ignore_nice_load in
      use_ondemand, when using ondemand governor instead of powernowd
      (LP: #60042)
    - Use /sys/devices/system/cpu/cpu[0-9]*/ to match CPUs and
      test if it is a directory (LP: #173711, LP: #107820)
    - Do not use "double slashes" in paths to avoid confusion
  * debian/cpufreq-detect.sh:
    - load e_powersaver if CPU has est flag (LP: #117446)
    - fix comparison for CPU_FAMILY=6 (LP: #162524)
    - use /bin/sh instead of /bin/bash for clarification
      (LP: #162524)
    (Patch from Jacob Nielsen, Ralph Janke)

  [ Steve Kowalik ]
  * Correct spelling of Original in Original-Maintainer.

 -- Steve Kowalik <email address hidden> Tue, 18 Dec 2007 19:49:36 +1100

Changed in powernowd:
status: Triaged → Fix Released
Revision history for this message
Steve Kowalik (stevenk) wrote :

Daniel, I've uploaded your debdiff, you should see the bugs get hit soonish. I've had to fix the Original-Maintainer field, as it was misspelt, could you watch for that in future? Could you also look at submitting our changes to Debian using something like submittodebian from ubuntu-dev-tools, as well?

Revision history for this message
Daniel Hahler (blueyed) wrote :

Steve, the misspelling came from ogra and I've not looked close enough when I've rediffed my patch (my original diff for 0.97-1ubuntu8 had it spelled correctly). I should have caught this, when I've rediffed.
Nice to see it finally uploaded, thanks.

From what I can tell, all those fixes do not affect Debian - therefor do not need to get submitted to them.

btw: using update-maintainer from ubuntu-dev-tools avoids misspelling of "Original" (and some typing).. ;)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.