Message ID | 20221019225846.2501109-9-paulmck@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | eed145877491fadb2fdec06ce86b5cf8ee645666 |
Headers | show |
Series | NMI-safe SRCU readers for v6.2 | expand |
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 87ae6f5c1edae..18bb696cff8ca 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -642,6 +642,8 @@ static void srcu_check_nmi_safety(struct srcu_struct *ssp, bool nmi_safe) if (!IS_ENABLED(CONFIG_PROVE_RCU)) return; + /* NMI-unsafe use in NMI is a bad sign */ + WARN_ON_ONCE(!nmi_safe && in_nmi()); sdp = raw_cpu_ptr(ssp->sda); old_nmi_safe_mask = READ_ONCE(sdp->srcu_nmi_safety); if (!old_nmi_safe_mask) {