[PATCH] suppress needless timer reprogramming {tick-sched.c}

From: Woodruff, Richard
Date: Mon Jun 16 2008 - 20:06:20 EST


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.

Richard W.

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.

Attachment: suppress_reprogram_2626-rc5.diff
Description: suppress_reprogram_2626-rc5.diff