Re: dynamic-hz

Russell King
2004-12-13T14:14:51Z

On Mon, Dec 13, 2004 at 01:58:20PM +0000, Russell King wrote:
> On Mon, Dec 13, 2004 at 08:43:55AM +0100, Stefan Seyfried wrote:
> > Con Kolivas wrote:
> > > Just being devils advocate here...
> > >
> > > I had variable Hz in my tree for a while and found there was one
> > > solitary purpose to setting Hz to 100; to silence cheap capacitors.
> >
> > power savings? Having the cpu wake up 1000 times per second if the
> > machine is idle cannot be better than only waking it up 100 times.
> >
> > Yes, i am always on the quest for the 5 extra minutes on battery :-)
>
> This is an easy thing to grab hold of, but rather pointless in the
> overall scheme of things. Those of us who have done power usage
> measurements know this already.
>
> The only case where this really makes sense is where the CPU power
> usage outweighs the power consumption of all other peripherals by
> at least an order of magnitude such that the rest of the system is
> insignificant compared to the CPU power.
>
> Lets take an example. Lets say that:
> * a CPU runs at about 245mA when active
> * 90mA when inactive
> * the timer interrupt takes 2us to execute 1000 times a second
> * no other processing is occuring
>
> This means that the average current consumption is about:
> 245mA * 2 * 10^-6 + 90mA * (1 - 2 * 10^-6) = 90.00031mA

Sorry, missed out the 1000 times a second. Grumble.

245mA * 1000 * 2 * 10^-6 + 90mA * (1 - 2 * 10^-6 * 1000) = 90.31mA

> This means that the timer interrupt has increased CPU power by
> 0.00034%.

0.34%

> Now, lets factor in the rest of a system. Lets the rest of the
> system takes 84mA. Recalculating (by increasing each figure by
> 84mA) gives us 174.00031mA, or an increase in overall system

174.31mA

> power by about 0.00018%.

0.18%

> Assuming your battery normally lasts exactly 24 hours on a current
> drain of 174.00031mA, completely eliminating the tick gives you

174.31mA

> an extra 0.15 seconds battery life.

2mins 30secs

> Note: the above CPU power consumption figures were taken from
> the Intel PXA255 processor electrical specifications, and the
> "rest of the system" current consumption taken from a real life
> device. The timer interrupt taking 2us is probably an over-
> estimation. Only the battery lifetime of 24 hours is ficticious.
>
> And yes, from time to time I keep thinking that it would be nice
> to eliminate the timer tick to save some power. However, I've
> never been able to justify the extra code complexity against the
> power savings. It really only makes sense if you can essentially
> _power off_ your system until the next timer interrupt (thereby,
> in the above example, reducing the power consumption by some 174mA)

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core