Support for printk in dynticks mode:

* Fix two races in irq work claiming

* Generalize irq_work support to all archs

* Don't stop tick with irq works pending. This
fix is generally useful and concerns archs that
can't raise self IPIs.

* Flush irq works before CPU offlining.

* Introduce "lazy" irq works that can wait for the
next tick to be executed, unless it's stopped.

* Implement klogd wake up using irq work. This
removes the ad-hoc printk_tick()/printk_needs_cpu()
hooks and make it working even in dynticks mode.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAABAgAGBQJQqCzoAAoJEIUkVEdQjox3SLgP/j2jpu8LievRIimnIw7+epc3
RPTCtLsujMubwlcccA1hC5f5jZNFHIYgmQSgf9T82UQI6RW6xYDZuLq3n4DfSyy+
no0VAnSnePz06FkQ0yTOsw+6hEhozXcxG9inPPacjFKoxLQIDPWqdqaen5zs5mbn
1aISn8eo74t1C9XmQdjFatSaGjO8nko+wlXP+75aFtVZV5kRHd2T3dB+WnZc+hvi
8GsySZKF2Ww01+B4E1blLAelkBpXLKySnNOBJtH8rf+HAVOfiY3zQTffpP2Jl3Uq
aae/IraFBzbgi7oH7/FjWn3zkqSm7spRUHVnOj0y81l/STH46b+RM4Z1UNjmq2io
9x9tP4cJr+KHnf94ar0EFRxDCAMEqH34vdXouWL8+1XjuID7oDJ32K5hpPIHL0FR
AgaB+DHVj0f0vdxDGjJlzr78pPsvbFxuiETco3j0SEcqm9iBW5ZEjDc9nJZv7ylq
iNny8ZfvePN42YGAyd1w/rbSVo7YzKt7GT7kDraUrRcSaPyrjACwezKioXTejaay
WHwZN87/Zel+f+dKZ1XmngcRxKQ17nGPYbv6R7blosg38F90gO9562OqEZP4hHi2
W86/5BdkbaoG9u3XLFTB9PwEnpswEXKhkgJwgm46eIIVdCyIuTZQO7M1f+nfm535
zw6BK50xn4K7NccTpYq4
=tBmD
-----END PGP SIGNATURE-----
printk: Wake up klogd using irq_work

klogd is woken up asynchronously from the tick in order
to do it safely.

However if printk is called when the tick is stopped, the reader
won't be woken up until the next interrupt, which might not fire
for a while. As a result, the user may miss some message.

To fix this, lets implement the printk tick using a lazy irq work.
This subsystem takes care of the timer tick state and can
fix up accordingly.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
5 files changed