From: Peter Zijlstra <peterz@infradead.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
eupm90@gmail.com, linux-kernel@vger.kernel.org, x86@kernel.org,
Andy Lutomirski <luto@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH] rcu: Allow rcu_irq_enter_check_tick() from NMI
Date: Mon, 16 Nov 2020 13:10:12 +0100 [thread overview]
Message-ID: <20201116121012.GC3121378@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201114010526.GK3249@paulmck-ThinkPad-P72>
Any which way around; here's a proper patch...
---
Subject: rcu: Allow rcu_irq_enter_check_tick() from NMI
From: Peter Zijlstra <peterz@infradead.org>
Date: Mon Nov 16 12:54:56 CET 2020
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.
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>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
---
kernel/rcu/tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- 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(),
next prev parent reply other threads:[~2020-11-16 12:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 12:53 #PF from NMI Peter Zijlstra
2020-11-13 17:16 ` Paul E. McKenney
2020-11-13 17:23 ` Andy Lutomirski
2020-11-13 23:13 ` Thomas Gleixner
2020-11-14 1:05 ` Paul E. McKenney
2020-11-16 12:10 ` Peter Zijlstra [this message]
2020-11-16 17:24 ` [PATCH] rcu: Allow rcu_irq_enter_check_tick() " Thomas Gleixner
2020-11-16 20:00 ` Paul E. McKenney
2020-11-16 16:46 ` #PF " Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201116121012.GC3121378@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=eupm90@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=paulmck@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox