Skip to content

Commit 19822e3

Browse files
committed
Merge tag 'rcu-urgent.2022.12.17a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
Pull RCU fix from Paul McKenney: "This fixes a lockdep false positive in synchronize_rcu() that can otherwise occur during early boot. The fix simply avoids invoking lockdep if the scheduler has not yet been initialized, that is, during that portion of boot when interrupts are disabled" * tag 'rcu-urgent.2022.12.17a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: rcu: Don't assert interrupts enabled too early in boot
2 parents b6bb967 + 3f6c3d2 commit 19822e3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

kernel/rcu/tree.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ static void rcu_poll_gp_seq_start(unsigned long *snap)
13621362
{
13631363
struct rcu_node *rnp = rcu_get_root();
13641364

1365-
if (rcu_init_invoked())
1365+
if (rcu_scheduler_active != RCU_SCHEDULER_INACTIVE)
13661366
raw_lockdep_assert_held_rcu_node(rnp);
13671367

13681368
// If RCU was idle, note beginning of GP.
@@ -1378,7 +1378,7 @@ static void rcu_poll_gp_seq_end(unsigned long *snap)
13781378
{
13791379
struct rcu_node *rnp = rcu_get_root();
13801380

1381-
if (rcu_init_invoked())
1381+
if (rcu_scheduler_active != RCU_SCHEDULER_INACTIVE)
13821382
raw_lockdep_assert_held_rcu_node(rnp);
13831383

13841384
// If the previously noted GP is still in effect, record the
@@ -1401,7 +1401,8 @@ static void rcu_poll_gp_seq_start_unlocked(unsigned long *snap)
14011401
struct rcu_node *rnp = rcu_get_root();
14021402

14031403
if (rcu_init_invoked()) {
1404-
lockdep_assert_irqs_enabled();
1404+
if (rcu_scheduler_active != RCU_SCHEDULER_INACTIVE)
1405+
lockdep_assert_irqs_enabled();
14051406
raw_spin_lock_irqsave_rcu_node(rnp, flags);
14061407
}
14071408
rcu_poll_gp_seq_start(snap);
@@ -1417,7 +1418,8 @@ static void rcu_poll_gp_seq_end_unlocked(unsigned long *snap)
14171418
struct rcu_node *rnp = rcu_get_root();
14181419

14191420
if (rcu_init_invoked()) {
1420-
lockdep_assert_irqs_enabled();
1421+
if (rcu_scheduler_active != RCU_SCHEDULER_INACTIVE)
1422+
lockdep_assert_irqs_enabled();
14211423
raw_spin_lock_irqsave_rcu_node(rnp, flags);
14221424
}
14231425
rcu_poll_gp_seq_end(snap);

0 commit comments

Comments
 (0)