]> git.baikalelectronics.ru Git - kernel.git/commit
rcu: Keep synchronize_rcu() from enabling irqs in early boot
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 20 Oct 2022 17:58:14 +0000 (10:58 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 20 Oct 2022 22:34:49 +0000 (15:34 -0700)
commit201c6f8c68b9ef140e13be2494219fa63bbe2a2e
tree9b97129027fd619ef63f8cebd7bab04d4c75ef7b
parent6358759813eb1920a7e9bc57799a80a94f6c66b8
rcu: Keep synchronize_rcu() from enabling irqs in early boot

Making polled RCU grace periods account for expedited grace periods
required acquiring the leaf rcu_node structure's lock during early boot,
but after rcu_init() was called.  This lock is irq-disabled, but the
code incorrectly assumes that irqs are always disabled when invoking
synchronize_rcu().  The exception is early boot before the scheduler has
started, which means that upon return from synchronize_rcu(), irqs will
be incorrectly enabled.

This commit fixes this bug by using irqsave/irqrestore locking primitives.

Fixes: 64f714130887 ("rcu: Switch polled grace-period APIs to ->gp_seq_polled")
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c