Skip to content

Commit 4540e84

Browse files
Peter Zijlstragregkh
authored andcommitted
rcu: Allow rcu_irq_enter_check_tick() from NMI
[ Upstream commit 6dbce04 ] Eugenio managed to tickle #PF from NMI context which resulted in hitting a WARN in RCU through irqentry_enter() -> __rcu_irq_enter_check_tick(). However, this situation is perfectly sane and does not warrant an WARN. The #PF will (necessarily) be atomic and not require messing with the tick state, so early return is correct. This commit therefore removes the WARN. Fixes: aaf2bc5 ("rcu: Abstract out rcu_irq_enter_check_tick() from rcu_nmi_enter()") Reported-by: "Eugenio Pérez" <eupm90@gmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent bbab483 commit 4540e84

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎kernel/rcu/tree.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,8 @@ void __rcu_irq_enter_check_tick(void)
928928
{
929929
struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
930930

931-
// Enabling the tick is unsafe in NMI handlers.
932-
if (WARN_ON_ONCE(in_nmi()))
931+
// If we're here from NMI there's nothing to do.
932+
if (in_nmi())
933933
return;
934934

935935
RCU_LOCKDEP_WARN(rcu_dynticks_curr_cpu_in_eqs(),

0 commit comments

Comments
 (0)