Skip to content

Commit 51cace1

Browse files
committed
rcu: Disable interrupts directly in rcu_gp_init()
Interrupts are enabled in rcu_gp_init(), so this commit switches from local_irq_save() and local_irq_restore() to local_irq_disable() and local_irq_enable(). Link: https://lore.kernel.org/all/[email protected]/ Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 6f94856 commit 51cace1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/rcu/tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,15 +1832,15 @@ static noinline_for_stack bool rcu_gp_init(void)
18321832
WRITE_ONCE(rcu_state.gp_state, RCU_GP_ONOFF);
18331833
/* Exclude CPU hotplug operations. */
18341834
rcu_for_each_leaf_node(rnp) {
1835-
local_irq_save(flags);
1835+
local_irq_disable();
18361836
arch_spin_lock(&rcu_state.ofl_lock);
18371837
raw_spin_lock_rcu_node(rnp);
18381838
if (rnp->qsmaskinit == rnp->qsmaskinitnext &&
18391839
!rnp->wait_blkd_tasks) {
18401840
/* Nothing to do on this leaf rcu_node structure. */
18411841
raw_spin_unlock_rcu_node(rnp);
18421842
arch_spin_unlock(&rcu_state.ofl_lock);
1843-
local_irq_restore(flags);
1843+
local_irq_enable();
18441844
continue;
18451845
}
18461846

@@ -1877,7 +1877,7 @@ static noinline_for_stack bool rcu_gp_init(void)
18771877

18781878
raw_spin_unlock_rcu_node(rnp);
18791879
arch_spin_unlock(&rcu_state.ofl_lock);
1880-
local_irq_restore(flags);
1880+
local_irq_enable();
18811881
}
18821882
rcu_gp_slow(gp_preinit_delay); /* Races with CPU hotplug. */
18831883

0 commit comments

Comments
 (0)