lkml.org 
[lkml]   [2020]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 167/717] rcu: Allow rcu_irq_enter_check_tick() from NMI
    Date
    From: Peter Zijlstra <peterz@infradead.org>

    [ Upstream commit 6dbce04d8417ae706596366e16841d77c454ba52 ]

    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: aaf2bc50df1f ("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>
    ---
    kernel/rcu/tree.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
    index bd04b09b84b32..655ade095e043 100644
    --- a/kernel/rcu/tree.c
    +++ b/kernel/rcu/tree.c
    @@ -928,8 +928,8 @@ void __rcu_irq_enter_check_tick(void)
    {
    struct rcu_data *rdp = this_cpu_ptr(&rcu_data);

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

    RCU_LOCKDEP_WARN(rcu_dynticks_curr_cpu_in_eqs(),
    --
    2.27.0


    \
     
     \ /
      Last update: 2020-12-28 16:39    [W:3.243 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site