rcu: Make Tiny RCU explicitly disable preemption
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 4 Mar 2024 23:33:33 +0000 (15:33 -0800)
committerUladzislau Rezki (Sony) <urezki@gmail.com>
Mon, 15 Apr 2024 09:29:48 +0000 (11:29 +0200)
commit11b8b378c58bdaf076c2724bee03157e3160af5f
treefe19b4486c4a528644943a949f02a286f6a68e90
parent3dbd8652f87b81fccb766bddb985ef46a1502f04
rcu: Make Tiny RCU explicitly disable preemption

Because Tiny RCU is used only in kernels built with either
CONFIG_PREEMPT_NONE=y or CONFIG_PREEMPT_VOLUNTARY=y, there has not been
any need for TINY RCU to explicitly disable preemption.  However, the
prospect of lazy preemption changes that, and preemption means that
the non-atomic increment in synchronize_rcu() can be preempted, with
the possibility that one of the increments is lost.  This could cause
failures for users of the APIs that poll RCU grace periods.

This commit therefore adds the needed preempt_disable() and
preempt_enable() call to Tiny RCU.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Ankur Arora <ankur.a.arora@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
kernel/rcu/tiny.c