Regarding the CPUFreq interface in HAL

Holger Macht hmacht at suse.de
Fri Jul 13 15:24:51 PDT 2007


On Fri 13. Jul - 14:18:35, Anup Pemmaiah wrote:
> Richard,
> 
> Really appreciate your comments and sorry for the delay in my response. 
> Some comments inline.
> 
> Richard Hughes wrote:
> 
> >On Thu, 2007-07-05 at 17:44 -0700, Anup Pemmaiah wrote:
> >  
> >
> >>Hi,
> >>
> >>I'm working with a group inside of Sun Microsystems to port Gnome Power
> >>Manager to Solaris.
> >>    
> >>
> >
> >Cool! Yell if you guys need a hand getting changes upstream :-)
> >
> >  
> >
> >>This effort will require me to implement one of the
> >>HAL interfaces,"org.freedesktop.Hal.Device.CPUFreq", on Solaris. As I've
> >>been considering how we might use this interface with our governors, 
> >>I've begun to think that the interface, as it is currently defined, is 
> >>not very flexible in its ability to handle multiple properties.
> >>
> >>For example, while considering one of our governors (one that is similar 
> >>to the Linux OnDemand governor), it occurred to me that we might want 
> >>the ability to configure properties related to threshold and sampling 
> >>rates (and possibly others). While the "SetCPUFreqPerformance" method 
> >>does provide a mechanism for defining at least one of these properties, 
> >>it doesn't seem like a good solution for multiple properties.
> >>    
> >>
> >
> >Do you _need_ to be able to change all the parameters from the session -
> >the idea of SetCPUFreqPerformance was to set a general "setting" rather
> >than be able to tweak every single knob.
> >
> >  
> >
> As of now, would really like to change atleast some of the parameters of 
> a session. Regarding all the parameters, we are not sure, but it seems 
> likely.

Do you really plan to change these parameters individually from the
session. In your concrete use case, from within gnome-power-manager?

> >>I'm curious whether or not there are any plans to extend this interface 
> >>in the future to better support more properties. I'd be happy to discuss 
> >>this further if you are interested.
> >>    
> >>
> >
> >Sure, suggest away.
> >  
> >
> Instead of having just a single value, will be nice to have a (key, 
> value) pair so that most of  the currently supported parameters can be 
> tweaked.Where "key" is the parameter to be tweaked and "value" is the 
> new value.
> Would like to propose the addition of the following two methods.
> 
> void setCPUFreqProperty(char *key, int value)
> int getCPUFreqProperty(char *key)

This would be some kind of just a generic sysfs level abstraction, where
you can assign any value (in this case only integers) to any key/sysfs
file below the CPUFreq namespace. I don't think that makes much sense to
put in HAL. HAL should already provide some kind of sensible abstraction.

Maybe you can tell us which concrete parameters you intend to tweak, so we
can think about if it would make sense for all platforms?

Just to make the current idea of the SetCPUFreqPerformance method more
clear: The code behind this method is intelligent enough to change several
parameters at once and knows what to do...

      	   	  	  /----> up_threshold
      	   	  	  |
  SetCPUFreqPerformance --|
			  |
			  \----> sampling_rate

Regards,
			  
	Holger


More information about the hal mailing list