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.

* 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)

iQIcBAABAgAGBQJQo/v9AAoJEIUkVEdQjox3OjkP/j7U8EbgU/DH0eRIBK1W3IRd
kR9IRiLev6+/RHY9Va7gRZfduA1rtWxTKfzVp0P+lPfPrRwj29raF/RTo2elx0RM
zT5pC/3v65g2raj08pBTMFxnrulbGbUbWcK/MFQH6KlA8e4ZC/gRTKxQWtsVV2Qn
YABAqoCe+x5dheivJcgy+leSsr11RWaRyNlWT1Bba1I39b4XYeQiuJoEL+drZp4b
gfCzwlhALrkFIkRrhVmJw2l3vvcVFjxXcVc1h4sy4Ao6lAcE+jzZotJr9KihOV/u
BGOuYfJhrP/7K6+imT9yHGsrD+zgYwsLE4cI91pWVE8XV4QlsvoiYMkgTUpgC/Wr
su9EXHYCJMRnfnpWoYXs91lllHjlMC/BfYwy9IKJhsnfGIuWjZaijDorveO1YyTF
dmqtG+MNd1A1PMHyur3E6D20nPYXpFd2jwMZcbk2O9lGhBEo9sOPaJJ7xMAIk9p1
qq9b17OWGFQQfedrhni3Tv0wY264KHpcyqo+/wmNQfuFWvMXPt6xuROT0R5zTUju
Eda9jjk9kzeuxMumE8pcrVlr3e1aHhHu6nwsspG5zzH04yH4jHwgktmKcicR7BTn
TDqM50ymLAyXUogm/dVaxSxFOShPakKMuO06dx3LMv8ZFb7WAaR+XPPGjjFTzr00
Piop4F6TsD/I2OalfFBG
=0xpI
-----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>
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: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
5 files changed