printk: use RCU to prevent potential lock contention in kmsg_dump
Huang Ying authored

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: default avatarHuang Ying <ying.huang@intel.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
fb842b00
Name Last commit Last update
debug kdb: fix crash when KDB_BASE_CMD_MAX is exceeded
gcov llseek: automatically add .llseek fop
irq sched: Constify function scope static struct sched_param usage
power Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
time Merge branch 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
trace Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
.gitignore Update kernel/.gitignore with new auto-generated files
Kconfig.freezer container freezer: implement freezer cgroup subsystem
Kconfig.hz sched: fix SCHED_HRTICK dependency
Kconfig.locks mutex: Better control mutex adaptive spinning config
Kconfig.preempt rcu: provide RCU options on non-preempt architectures too
Makefile kernel: clean up USE_GENERIC_SMP_HELPERS
acct.c pass a struct path to vfs_statfs
async.c async: use workqueue for worker pool
audit.c audit: Use rcu for task lookup protection
audit.h audit: make functions static
audit_tree.c in untag_chunk() we need to do alloc_chunk() a bit earlier
audit_watch.c audit: make functions static
auditfilter.c Audit: add support to match lsm labels on user audit messages
auditsc.c audit mmap
backtracetest.c backtrace: replace timer with tasklet + completions
bounds.c kbuild: move bounds.h to include/generated
capability.c sched: Remove remaining USER_SCHED code
cgroup.c fs: dcache reduce branches in lookup path
cgroup_freezer.c cgroup_freezer: update_freezer_state() does incorrect state transitions
compat.c
configs.c
cpu.c
cpuset.c
cred.c
delayacct.c
dma.c
elfcore.c
exec_domain.c
exit.c
extable.c
fork.c
freezer.c
futex.c
futex_compat.c
groups.c
hrtimer.c
hung_task.c
hw_breakpoint.c
irq_work.c
itimer.c
jump_label.c
kallsyms.c
kexec.c
kfifo.c
kmod.c
kprobes.c
ksysfs.c
kthread.c
latencytop.c
lockdep.c
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
module.c
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
notifier.c
ns_cgroup.c
nsproxy.c
padata.c
panic.c
params.c
perf_event.c
pid.c
pid_namespace.c
pm_qos_params.c
posix-cpu-timers.c
posix-timers.c
printk.c
profile.c
ptrace.c
range.c
rcupdate.c
rcutiny.c
rcutiny_plugin.h
rcutorture.c
rcutree.c
rcutree.h
rcutree_plugin.h
rcutree_trace.c
relay.c
res_counter.c
resource.c
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c
rtmutex.h
rtmutex_common.h
rwsem.c
sched.c
sched_autogroup.c
sched_autogroup.h
sched_clock.c
sched_cpupri.c
sched_cpupri.h
sched_debug.c
sched_fair.c