dtrace: new cyclic implementation
The original cyclic implementation (based on hrtimer_*()) failed
because it caused handlers to be called from interrupt context, which
causes quite some interesting (bad) side effects.
The change to tasklet_hrtimer_*() as underlying implementation solved
the context issues for handlers, but resulted in runaway timers that
could call handlers in modules that are no longer loaded, causing a
crash. Cause was related to a race between timer cancellation and the
tasklet restarting the timer.
The new implementation is a two layer approach where hrtimer_*() is
used to generate handler invocations requests, scheduling a tasklet for
handler call processing as needed, and using a counter to determine how
many times the handler needs to be called (if the timer fires more than
once between two subsequent tasklet processing schedulings). The
tasklet (one per cyclic - only scheduled when there has been one or
moretimer expirations) takes care of calling the handler.
More details are embedded in comments in the code...
Orabug:
17553446
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>