Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 234759 - Gentoo PPC FAQ should precise about kernel governors availability
Summary: Gentoo PPC FAQ should precise about kernel governors availability
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: PPC Linux
: High enhancement (vote)
Assignee: nm (RETIRED)
URL: http://www.gentoo.org/doc/en/gentoo-p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-14 18:30 UTC by Mounir Lamouri (volkmar) (RETIRED)
Modified: 2009-04-15 07:04 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mounir Lamouri (volkmar) (RETIRED) gentoo-dev 2008-08-14 18:30:42 UTC
Follow this url : http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml#laptoppkgs

For the question "I'm running Gentoo on a PowerPC laptop. What packages should I install to enable laptop-specific functionality?", one recommended package is powernowd for cpu scaling. Excellent choice for advanced kernel governors independant software.

Actually, advanced kernel governors (ondemand, ...) works only on some configurations (see help on linux menuconfig) and obviously not on my Powerbook G4. Indeed, I tried to use cpufreqd but as it is using governors it was not working properly. I spent some hours before realizing it was because governors don't work everywhere.

I think it could be interesting to inform people reading the FAQ that it can be the same on their laptops. Additionally, adding a link to the complete guide about power management on gentoo (http://www.gentoo.org/doc/en/power-management-guide.xml) will be useful.
Comment 1 nm (RETIRED) gentoo-dev 2008-09-02 07:36:14 UTC
CCing the PPC guys. Whatcha think of this? Worth adding? If so, I need something a littl more concrete, rather than "this may not work for you" -- alternatives for those situations are appreciated.
Comment 2 Mounir Lamouri (volkmar) (RETIRED) gentoo-dev 2008-09-13 22:01:16 UTC
(In reply to comment #1)
> CCing the PPC guys. Whatcha think of this? Worth adding? If so, I need
> something a littl more concrete, rather than "this may not work for you" --
> alternatives for those situations are appreciated.
> 

Sorry for the time I took to answer, I have no internet connection at home for the moment.
After a search into the linux kernel, I've found what I was looking for. First of all, in Documentation/cpu-freq/governors.txt we can read that ondemand and conservative governors need a CPU that must have the capability to switch the frequency very quickly.
The governors C files explain more things about this. Actually, it is written that "For CPUs with transition latency > 10mS (mostly drivers with CPUFREQ_ETERNAL) this governor will not work." into drivers/cpufreq/cpufreq_[ondemand|conservative].c. I assume there is a check somewhere blocking those drivers.
I've found there is only one driver for all 32 bits PowerPC Mac and another for 64 bits ones. 32 bits driver (arch/powerpc/platforms/powermac/cpufreq_32.c) begins with a TODO explaining that this driver don't check the machine's type. That's not good. The init function (pmac_cpufreq_cpu_init) set the transition_latency variable to CPUFREQ_ETERNAL that makes impossible to use ondemand and conservative governors. For 64 bits driver, the init function is also setting transition_latency variable to CPUFREQ_ETERNAL.

Note : in include/linux/cpufreq.h we can read that CPUFREQ_ETERNAL is a special value used when transition latency is unknown.

That makes ondemand and conservative governors not working for all PowerPC Macintosh. At least with linux kernel <= linux-2.6.24-gentoo-r3 (last stable PPC gentoo-sources). A quick check should be done to verify if it has been fixed in latest release.

About the alternative, there are two. For a manual setting, using powersave, performance or userspace governors. For an automated setting, using a software that is only using those governors.
I recommand powernowd that is using userspace governor to set the best CPU frequency. It is a good alernative to advanced governors. It's just doing a good job out of the box.
There are other software listed here : http://www.gentoo.org/doc/en/power-management-guide.xml#doc_chap3
Comment 3 nm (RETIRED) gentoo-dev 2009-01-26 08:56:25 UTC
PPC, we need some feedback, please. See comment #1.
Comment 4 Joe Jezak (RETIRED) gentoo-dev 2009-01-26 13:55:00 UTC
Sorry, for some reason this bug wasn't showing up in my bug list, so I had not seen the comments.

I already do mention in the laptop section of the FAQ that one should use a userspace CPU daemon, the exact text is:

> powernowd allows cpu speed scaling for longer battery life. Other packages
> also provide the same functionality, such as cpudyn, cpufreqd and speedfreq.
> It doesn't really matter which you chose, just ensure that you have the 
> userspace cpu frequency scaling governor enabled in your kernel.

I guess it wouldn't hurt to expand on this to make it more clear that this is the only option? I don't understand what Mounir is suggesting in the first comment. cpuydynd, powernowd, etc. all work fine on all PowerPC machines that can change frequency. It is only the "On Demand" type governors that do not work at all,as the CPU takes too long to settle after a speed switch for these to work.

So, should I make it more clear that you *must* do this for cpu frequency scaling, or is the existing text adequate?
Comment 5 nm (RETIRED) gentoo-dev 2009-04-15 07:04:19 UTC
Fixed in CVS.