Skip to content

Commit fcd53c8

Browse files
qiangzh3paulmckrcu
authored andcommitted
rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE()
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 <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 568035b commit fcd53c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/tasks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static int __noreturn rcu_tasks_kthread(void *arg)
560560
static void synchronize_rcu_tasks_generic(struct rcu_tasks *rtp)
561561
{
562562
/* Complain if the scheduler has not started. */
563-
RCU_LOCKDEP_WARN(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE,
563+
WARN_ONCE(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE,
564564
"synchronize_rcu_tasks called too soon");
565565

566566
// If the grace-period kthread is running, use it.

0 commit comments

Comments
 (0)