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.12 (GNU/Linux)

iQIcBAABAgAGBQJQzyuqAAoJEIUkVEdQjox3BPYP/00SrvnMWLDEAkbdLzBLGf94
AOopVab5EgAFus9EoTlhqDCfwJ3ChfzsMjfq2tIbpVmY2Eyms2BALmoxI3IUxQpC
MFTkpxGbReT4DAFrUNY6xBJtNvzzSGEWVVvigmcYsyKRFJXyRrby0PimcBPh2mmC
qk/O9PtPr/EKpn0IKc302TT7jXYLHm7atgznC/UFFZ8sjHjInlHtvgz0tgkhyZBo
DHjFw5dVZe2Gt0XP8hRs9s7nNu+evoHaBk04B5TcUfsIFh78OYeCMU0m5vN/uXN4
dZnWC+jU9WaJMRuRSzfqOjd/aFOmI9fxc4MToGyMdy9phaCe7GOJNY8a6duI5VLx
58fW2gKUekAPZ1lZ3YUQteNOclQd3CrEjf9c0G6vArXNBIcCJZSfU/1rpGmbdhsA
P9UKRoBdqaDzN1wSdHWQGR6DD8VsBRrjwHePgTBMrAkjrI+6vqSPNyg+H0vIxeJu
o/hRKtqeOHe8et8AwIHfRs5Cy95z6OCOQPGSruNf9Z9eEXekYks94JO6t3+nIQ72
v33N1aDZu/iczgPuzZLJpDa6Hky9pxANHiIliZy7+RoCDJHzJgcIv511V+5Qj0L2
UkY3//CvCAMy52ClCMQVGTS+GNrE9mtr0p/XZoj8u5D8CiALVHqGc31vbfgp7RcA
uKg6chfQaSDfuudj76gM
=AGRC
-----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