[PATCH 0/3] CPU frequency scaling addon

Holger Macht hmacht at suse.de
Mon Aug 14 11:22:26 PDT 2006


On Mon 14. Aug - 19:22:37, Richard Hughes wrote:
> On Mon, 2006-08-14 at 19:54 +0200, Holger Macht wrote:
> > On Mon 14. Aug - 18:48:23, Richard Hughes wrote:
> > > On Sat, 2006-08-12 at 12:34 +0200, Holger Macht wrote:
> > > > Just save the mail. diff ignores everything except the diff.
> > > 
> > > Yes, that worked, thanks.
> > > 
> > > Apart from looking in /org/freedesktop/Hal/devices/computer:info.addons
> > > for the hald-addon-cpufreq addon name, is there a way for desktop
> > > programs to find out if HAL can manage CPU scaling?
> > > 
> > > Maybe we need a power_management.can_do_cpu_scaling key or something
> > > more suitable.
> > 
> > 
> > Maybe checking if the CPUFreq methods are listed in the
> > org.freedesktop.Hal.Device.SystemPowerManagement.method_names key is
> > enough?
> > 
> > And if so, use the GetCPUFreqAvailableGovernors method to check if there
> > are governors to be used.
> 
> Hmm. It's making it a bit difficult for applications to work out "can I
> control the cpu frequency with HAL" but I guess it works for me.

If you like to control CPUFreq with HAL, you have to check which governors
are available anyway.

Such a property maybe handy, although I don't think it's necessary. Let me
think about it once more when I'm going to do the next patch version ;-)

> 
> > > 
> > > I also noticed the addon doesn't exit if the computer doesn't have
> > > a /sys/devices/system/cpu/cpu0/cpufreq/ directory which would probably
> > > be a good thing.
> > 
> > But if a cpufreq driver (e.g. speedstep_centrino) or a governor is loaded
> > after the addon exited but during runtime of HAL, the system suddenly gets
> > CPUFreq capabilities but it couldn't be used anymore.
> 
> Yes, I wondered this. I figured the modules normally would be loaded
> before HAL started and thus wouldn't be a problem. Agreed this wouldn't
> be ideal.
> 
> Is there a way we can get an event from the kernel like "new cpufreq
> module inserted" so can can then match and run the addon if not already
> started?

Maybe. At least the hald --verbose=yes output gives me the following line
when inserting a governor:

20:19:42.288 [I] osspec.c:232: SEQNUM=1585, ACTION=add, SUBSYSTEM=module, DEVPATH=/sys/module/cpufreq_powersave, DEVNAME=, IFINDEX=0

But I currently don't now how to catch this in an fdi file or the
like. You have to check if the addon is already running and only if not,
start it.

Regards,
	Holger


More information about the hal mailing list