[PATCHv6 01/11] clockevents: Prefer CPU local devices over global devices

Sören Brinkmann soren.brinkmann at xilinx.com
Thu May 23 17:33:01 EDT 2013


On Mon, May 13, 2013 at 12:26:05PM -0700, Stephen Boyd wrote:
> On an SMP system with only one global clockevent and a dummy
> clockevent per CPU we run into problems. We want the dummy
> clockevents to be registered as the per CPU tick devices, but
> we can only achieve that if we register the dummy clockevents
> before the global clockevent or if we artificially inflate the
> rating of the dummy clockevents to be higher than the rating
> of the global clockevent. Failure to do so leads to boot
> hangs when the dummy timers are registered on all other CPUs
> besides the CPU that accepted the global clockevent as its tick
> device and there is no broadcast timer to poke the dummy
> devices.
> 
> If we're registering multiple clockevents and one clockevent is
> global and the other is local to a particular CPU we should
> choose to use the local clockevent regardless of the rating of
> the device. This way, if the clockevent is a dummy it will take
> the tick device duty as long as there isn't a higher rated tick
> device and any global clockevent will be bumped out into
> broadcast mode, fixing the problem described above.
> 
> Reported-by: Mark Rutland <mark.rutland at arm.com>
> Tested-by: Mark Rutland <mark.rutland at arm.com>
> Cc: John Stultz <john.stultz at linaro.org>
> Cc: Thomas Gleixner <tglx at linutronix.de>
> Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
Tested-by: Sören Brinkmann <soren.brinkmann at xilinx.com>

I tested this on Zynq. Zynq uses the ARM twd timer as clockevent devices when
available. When I remove the twd nodes from DT the clockevent device is
a timer common to both CPUs. Without this patch this seems to stall the
second CPU resulting in the system to hang sooner or later.

[   65.360000] INFO: rcu_preempt detected stalls on CPUs/tasks:
[   65.360000]  1: (1 GPs behind) idle=56e/0/0 softirq=0/0 
[   65.360000]  (detected by 0, t=6502 jiffies, g=4294966997, c=4294966996, q=6844)
[   65.360000] Task dump for CPU 1:
[   65.360000] swapper/1       R running      0     0      1 0x00000000

With this patch everything looks fine.

	Sören





More information about the linux-arm-kernel mailing list