Thomas,
Does this patch look ok?
It simply does a check to see if the about to be reprogrammed 1 shot already is the last event programmed in the hardware. If it is it skips calling the hardware.
In my device I get many interrupts from a high speed USB device in a very short period of time. The system spends a lot of time reprogramming the hardware timer which is in a slower timing domain as compared to the CPU. This results in the CPU spending a huge amount of time waiting for the timer posting to be done. All of this reprogramming is useless as the wake up time has not changed.
As measured using ETM trace this drops my reprogramming penalty from almost 60% CPU load down to 15% during high interrupt rate. If you like I can send traces to show this.
Regards,
Richard W.
BTW:
I can much the other 15% by keeping the ticker on by using a function like there is for rcu today in tick-sched.c. Something like an irq_needs_cpu() by the rcu_needs_cpu() check. Where return = 1 if (curr_irq_ts - last_irq_ts < min_delta_ns). A time stamp is taken in irq code at entry.
On Wednesday 18 June 2008, Woodruff, Richard wrote:
> >
> > As measured using ETM trace this drops my reprogramming penalty from
> > almost 60% CPU load down to 15% during high interrupt rate. ?If you like
> > I can send traces to show this.
More than doubling the available-for-real-use CPU time! Impressive.
I'd imagine that many systems using reprogrammable 32K timers for
scheduling could win from such a patch, although not necessarily
quite so visibly as on this ARM unless their CPU clocks were also
in the 500+ MHz range.
Seems like a "law of unintended consequences" here. Use a 32K
timer since it takes less power than a multi-MHz one, and so the
faster clocks can be gated off more comprehensively (in hardware)
to give more power savings. Then throw NO_HZ on top to get one
more increment of power savings ... whoops, it was assuming that
it was dirt cheap to reprogram timers, major badness!
- Dave