]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: new cyclic implementation
authorKris Van Hees <kris.van.hees@oracle.com>
Tue, 22 Oct 2013 09:19:25 +0000 (05:19 -0400)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 21 Jul 2015 14:29:21 +0000 (15:29 +0100)
commita3e9a59bf86afe0126b9d73bdd93264c83397af1
treed3a533ce28772ee97f54a04f88a4382c1bfc4f8d
parent6e7544a2d788cb97e1aed2b8ff344af91f372fd2
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>
include/linux/cyclic.h
kernel/dtrace/Makefile
kernel/dtrace/cyclic.c [new file with mode: 0644]
kernel/dtrace/dtrace_os.c