timers/tick/broadcast-hrtimer: Fix suspicious RCU usage in idle loop
authorPreeti U Murthy <preeti@linux.vnet.ibm.com>
Wed, 18 Mar 2015 10:49:27 +0000 (16:19 +0530)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 24 Apr 2015 21:14:12 +0000 (17:14 -0400)
commitb27b4b79d535672a19e9d0fe1256ad1016cc9e7f
tree669950890f9a36f1ae29a8d3d3f9c1b80f93f16e
parent02d51afc23e02e580e872cfc57d043c7a018505b
timers/tick/broadcast-hrtimer: Fix suspicious RCU usage in idle loop

[ Upstream commit a127d2bcf1fbc8c8e0b5cf0dab54f7d3ff50ce47 ]

The hrtimer mode of broadcast queues hrtimers in the idle entry
path so as to wakeup cpus in deep idle states. The associated
call graph is :

cpuidle_idle_call()
|____ clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, ....))
     |_____tick_broadcast_set_event()
   |____clockevents_program_event()
|____bc_set_next()

The hrtimer_{start/cancel} functions call into tracing which uses RCU.
But it is not legal to call into RCU in cpuidle because it is one of the
quiescent states. Hence protect this region with RCU_NONIDLE which informs
RCU that the cpu is momentarily non-idle.

As an aside it is helpful to point out that the clock event device that is
programmed here is not a per-cpu clock device; it is a
pseudo clock device, used by the broadcast framework alone.
The per-cpu clock device programming never goes through bc_set_next().

Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: linuxppc-dev@ozlabs.org
Cc: mpe@ellerman.id.au
Cc: tglx@linutronix.de
Link: http://lkml.kernel.org/r/20150318104705.17763.56668.stgit@preeti.in.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
kernel/time/tick-broadcast-hrtimer.c