[Question] Local Timer based on SPI

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Nov 29 06:05:08 EST 2010


On Mon, Nov 29, 2010 at 07:25:30PM +0900, Kukjin Kim wrote:
> Yeah, it seems CONFIG_LOCAL_TIMER is just for PPI.
> 
> The purpose of my question is for the plan to use different SPIs to support
> each CPU event timer. According to the help message of LOCAL_TIMER in
> Kconfig, it seems better each CPU has a different event timer source clock
> instead of using IPI broadcast method. Current ARM implementation registers
> dummy_timers when CONFIG_LOCAL_TIMERS is not set so, I think need to set
> CONFIG_LOCAL_TIMERS.

The dummy timer clock event device is setup to provide the core with a
means to broadcast the timer IPI when there isn't a local timer.  When
there is a local timer, this function falls to the local timer clock
event device (which is actually the same structure, just initialized in
a different way.)

> To support different SPIs for each CPU event timer, should I neglect the
> dummy_timer?
> Or is it not worth to implement?...

It depends how many CPU cores you have.  If you have just two, then the
"thundering herd" issue may not affect you too much.

The idea behind local timers is to avoid all CPUs being woken at the same
point in time, and then immediately contending over the same set of locks.
Local timers help to distribute the wakeups throughout the interval, and
thereby avoid contention.

If you have one CPU and you IPI the timer to it, then you've probably
already done much of the work with the locks held already.



More information about the linux-arm-kernel mailing list