rcu: Avoid reporting strict QSes from NMI context

Although rcu_read_unlock_strict() avoids reporting quiescent states
from interrupts-disabled and preemption-disabled regions of code,
and also avoids any attempt to report quiescent states before the RCU
grace-period kthread has been spawned, it happily reports quiescent
states from within NMI handlers.  This breaks the RCU guarantee, even
if only in kernels built with CONFIG_RCU_STRICT_GRACE_PERIOD=y.

This commit therefore adds a check of in_nmi() to the early-exit
check in rcu_read_unlock_strict() in order to keep NMI handlers
free of improper quiescent-state reporting.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 file changed