RFC: powerd algorithms enhancements

Sam Leffler sam at freebsd.org
Thu Nov 6 08:22:26 PST 2008


Alexander Motin wrote:
>> The biggest problem I see with powerd is that when a system is running 
>> with a reduced clock frequency interrupts are not processed at full 
>> clock speed.  This, for example, breaks the ath driver which can 
>> generate interrupts very quickly when  h/w MIB counters overflow in a 
>> noisy environment.  Because processing happens at the reduced frequency 
>> until powerd gets to run it causes livelock
>>     
>
> You wanted to say that ath driver/hardware unable to operate on slow CPUs? Ok, but may be it is an ath driver problem? May be it must use some kind of interrupt moderation to avoid it?
>   

You didn't understand me.  I used ath as an example of the general problem.

>   
>> (or perhaps powerd does not 
>> raise the clock frequency because it's only accounting for user code--I 
>> haven't looked).
>>     
>
> powerd counts all nonidle load from system CPU stats. My patch makes it even more accurate in some cases.
>
>   
>> There's been talk about temporarily boosting the clock frequency in the 
>> kernel when processing interrupts.
>>     
>
> I am not sure it is a good idea. First, CPU may not be able to adapt it's power (voltage) level so fast, and the second, one of powerd goals is to deny CPU reach full frequency until it is really needed to reduce peak current cunsumption which will drain battery faster.
>
>   
I believe other systems use strategies similar to what I described.  
John Baldwin and I have talked about this in the past.  I was just 
trying to get you interested in looking at a more important problem.

    Sam



More information about the freebsd-mobile mailing list