rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE()
authorZqiang <qiang1.zhang@intel.com>
Tue, 12 Jul 2022 08:26:05 +0000 (16:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:29 +0000 (12:35 +0200)
commit7ed95b080334e1c9ee13a727fae80cf3f8a2dcb4
tree71445c3915b96383d3ed4420b7f6f04211f01402
parentcf38a05eb1d0bbdcdf40fbd5509b255333c394e1
rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE()

[ Upstream commit fcd53c8a4dfa38bafb89efdd0b0f718f3a03f884 ]

Kernels built with CONFIG_PROVE_RCU=y and CONFIG_DEBUG_LOCK_ALLOC=y
attempt to emit a warning when the synchronize_rcu_tasks_generic()
function is called during early boot while the rcu_scheduler_active
variable is RCU_SCHEDULER_INACTIVE.  However the warnings is not
actually be printed because the debug_lockdep_rcu_enabled() returns
false, exactly because the rcu_scheduler_active variable is still equal
to RCU_SCHEDULER_INACTIVE.

This commit therefore replaces RCU_LOCKDEP_WARN() with WARN_ONCE()
to force these warnings to actually be printed.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/rcu/tasks.h