]> git.baikalelectronics.ru Git - kernel.git/commit
printk: use RCU to prevent potential lock contention in kmsg_dump
authorHuang Ying <ying.huang@intel.com>
Thu, 13 Jan 2011 00:59:43 +0000 (16:59 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jan 2011 16:03:09 +0000 (08:03 -0800)
commit9fc7d800cbb05e5538186105fc3cd07261a2b04c
treecef7e6a0bd01849fcfc911f36293304f9ba7b3c2
parentc86cd849fccc806eb789d21951076b1c6d84a7fc
printk: use RCU to prevent potential lock contention in kmsg_dump

dump_list_lock is used to protect dump_list in kmsg_dumper implementation,
kmsg_dump() uses it to traverse dump_list too.  But if there is contention
on the lock, kmsg_dump() will fail, and the valuable kernel message may be
lost.

This patch solves this issue with RCU.  Because kmsg_dump() only read the
list, no lock is needed in kmsg_dump().  So that kmsg_dump() will never
fail because of lock contention.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/printk.c