]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sysrq: rcu-ify __handle_sysrq
authorRik van Riel <riel@redhat.com>
Thu, 22 May 2014 00:54:34 +0000 (10:54 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 4 Jun 2014 07:51:11 +0000 (17:51 +1000)
commit5166e53189cafc8ef4e08b486c8e82af115c0873
tree901567cec4f2caf5298a11deaa66c4422041ad30
parentb2fb0812fe50324e3310d68291d0aae9ca78e925
sysrq: rcu-ify __handle_sysrq

Echoing values into /proc/sysrq-trigger seems to be a popular way to get
information out of the kernel.  However, dumping information about
thousands of processes, or hundreds of CPUs to serial console can result
in IRQs being blocked for minutes, resulting in various kinds of cascade
failures.

The most common failure is due to interrupts being blocked for a very long
time.  This can lead to things like failed IO requests, and other things
the system cannot easily recover from.

This problem is easily fixable by making __handle_sysrq use RCU instead of
spin_lock_irqsave.

This leaves the warning that RCU grace periods have not elapsed for a long
time, but the system will come back from that automatically.

It also leaves sysrq-from-irq-context when the sysrq keys are pressed, but
that is probably desired since people want that to work in situations
where the system is already hosed.

The callers of register_sysrq_key and unregister_sysrq_key appear to be
capable of sleeping.

Signed-off-by: Rik van Riel <riel@redhat.com>
Reported-by: Madper Xie <cxie@redhat.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/tty/sysrq.c