]> git.baikalelectronics.ru Git - kernel.git/commit
rcu: Make RCU_LOCKDEP_WARN() avoid early lockdep checks
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 14 Dec 2022 19:41:44 +0000 (11:41 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:48 +0000 (09:33 +0100)
commit42f7ac6dc9429132fa8cac427f97b62712c3648a
tree77b0a59128497e1b02967e49cac015073e42b7e1
parent5653e4c32e23b86ec1329d39435a508efde837ab
rcu: Make RCU_LOCKDEP_WARN() avoid early lockdep checks

[ Upstream commit 011f67cad6e4bd65b15517f268745a1545f1ee7a ]

Currently, RCU_LOCKDEP_WARN() checks the condition before checking
to see if lockdep is still enabled.  This is necessary to avoid the
false-positive splats fixed by commit a939e4a298dfaa ("rcu: Reject
RCU_LOCKDEP_WARN() false positives").  However, the current state can
result in false-positive splats during early boot before lockdep is fully
initialized.  This commit therefore checks debug_lockdep_rcu_enabled()
both before and after checking the condition, thus avoiding both sets
of false-positive error reports.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Reported-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/rcupdate.h