OSDN Git Service

rcu: Don't assert interrupts enabled too early in boot
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 15 Dec 2022 17:26:09 +0000 (09:26 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Sun, 18 Dec 2022 00:12:20 +0000 (16:12 -0800)
commit3f6c3d29df58f391cf487b50a24ebd24045ba569
tree4c563b754020aa226a98dead459291358ce52609
parent31d8aaa87fcef1be5932f3813ea369e21bd3b11d
rcu: Don't assert interrupts enabled too early in boot

The rcu_poll_gp_seq_end() and rcu_poll_gp_seq_end_unlocked() both check
that interrupts are enabled, as they normally should be when waiting for
an RCU grace period.  Except that it is legal to wait for grace periods
during early boot, before interrupts have been enabled for the first time,
and polling for grace periods is required to work during this time.
This can result in false-positive lockdep splats in the presence of
boot-time-initiated tracing.

This commit therefore conditions those interrupts-enabled checks on
rcu_scheduler_active having advanced past RCU_SCHEDULER_INACTIVE, by
which time interrupts have been enabled.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/rcu/tree.c