Use 'ondemand' cpufreq governor

Bug #13610 reported by Allison Karlitskaya
30
Affects Status Importance Assigned to Milestone
powernowd (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

When running on battery on a laptop, Ubuntu should use the 'ondemand' cpufreq
governor that exists in recent 2.6 kernels.

I don't run Ubuntu, so I'm not sure what the situation is now, but:

00:48 <jdub> desrt: you have any interest in filing that as an ubuntu
             enhancement bug?

Anyway, you can enable this, by
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Cheers.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

I should mention: using this governor removes the need for a cpufreq daemon to
be running. You just have to turn it on/off when going on battery/AC power.

Revision history for this message
Thom May (thombot) wrote :

Will look at this for Breezy; it's way too late in the game for hoary now.

Revision history for this message
Kai F. Lahmann (kl) wrote :

better "conservative" than "ondemand" imho: increase the clock slow, decrease it fast.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

Kai: "conservative" could lead to bad user experience (skipping music, etc) due
to slower response to a demand for CPU power. Part of the benefit of having
this functionality in the kernel is the reduced latency.

Thom: any word on this? ubuntu-desktop in breezy still appears to depend on
powernowd.

Revision history for this message
Kai F. Lahmann (kl) wrote :

I have powernowd running with -m2 everywhere, and never had such problems (not no mention, that every sich CPU is even in
slowest clock fast enough for MP3 and most even for DVD [not shure about a Pentium M at 600MHz]). The CPU takes afaik at most
50ms to switch the clock, so I don't expect eny problems.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

*** Bug 17812 has been marked as a duplicate of this bug. ***

Revision history for this message
John Moser (nigelenki) wrote :

The 'userspace' governor used by default appears to be pretty much 'ondemand' in
userspace, which is a waste of time. 'conservative' may be interesting.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

'userspace' isn't just a waste of time -- it adds latency.

Revision history for this message
Matthew Garrett (mjg59) wrote :

This so is not a gnome-power-manager bug

Revision history for this message
sam tygier (samtygier) wrote :

wouldn't g-p-m be able to turn this one and off when needed? feel free to assign to somewhere else.

Revision history for this message
Richard Hughes (richard-hughes) wrote :

The eventual aim is to use the power.d functionality in pm-utils, which is called from the HAL method SetLowPowerMode. There is more details on the bigger plan in the presentaion on hughsie.com (my website) -- this is something that is being activly worked on, and the newest versions of HAL will soon depend on pm-utils unconditionally. So yes -- just give me a few weeks and there'll be a nice script-pluggable interface for stuff like this to use.

For the super-keen, CVS pm-utils has this functionality although you might need to hack a bit to get it to compile.

Richard.

Revision history for this message
Richard Hughes (richard-hughes) wrote :

Now this is happening in the HAL layer thanks to Holger Macht, this is something that will be configurable in gnome-power-manager really soon. Watch my blog for progress.

Revision history for this message
Richard Hughes (richard-hughes) wrote :

Support for cpufreq scaling is present in g-p-m CVS head.

Revision history for this message
Matthew Garrett (mjg59) wrote :

We now use ondemand on hardware that supports it.

Changed in gnome-power-manager:
status: Unconfirmed → Fix Released
Revision history for this message
Paul Sladen (sladen) wrote :

powernowd (0.97-1ubuntu5) edgy; urgency=low

  * Use ondemand if possible
  * Switch back to performance if powernowd is stopped

 -- Matthew Garrett <email address hidden> Tue, 5 Sep 2006 14:13:11 +0100

Revision history for this message
Loom (loom) wrote : Re: Use 'ondemand' cpufreq governor [but not always]

I just got aware that powernowd isn't used anymore. I always used '-m 2' like Kai and would prefer 'conservative' governor. But the only way to change it, is to edit the init-script. That's not a big issue but it's not the clean way. I would prefer to set an option in /etc/default/powernowd to select a governor or the powernowd deamon.

For now I edit my script. But it's so simple, please package it.

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

Loom: yup, I think there's a bug somewhere for "move the initscript currently in 'powernowd' to a new package with a proper /etc/default/foo" configuration. Could you open a new bug for that if you can't find it.

Revision history for this message
teedog (teedog) wrote :

I've heard a lot of reports of horrid battery life in Ubuntu compared to Windows XP. Isn't defaulting to "ondemand" when unplugged the issue? Correct me if I'm wrong, but I thought the default settings in Windows XP are "ondemand" when on AC and "powersave" when unplugged. "ondemand" is extremely sensitive to CPU usage, so basically, as long as the computer isn't completely idle, the CPU will run at max speed, even when doing mundane stuff like browsing the web or doing word processing. That eats up your battery life extremely quickly.

I am running an old Pentium M 1.8 GHz that throttles to 600 MHz on "powersave". I have no issues whatsoever playing videos (even H.264 video) and music without skipping in Windows XP. Thus, I strongly suggest Ubuntu default to "powersave" mode when a laptop is unplugged. If that is unacceptable, at least use "conservative". As it is, laptop users who don't know how to manually change the governor setting will likely shy away from Ubuntu due to short battery life.

Revision history for this message
Matthew Garrett (mjg59) wrote :

No, for modern CPUs the power difference between being idle and executing instructions is greater than the amount saved by reducing the frequency of the processor. It generally makes sense to run as fast as possible in order to return to idle faster.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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