public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: paulmck@kernel.org
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com,
	mingo@kernel.org, jiangshanlai@gmail.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
	"Paul E . McKenney" <paulmck@kernel.org>
Subject: [PATCH tip/core/rcu 10/16] rcu,ftrace: Fix ftrace recursion
Date: Thu,  5 Nov 2020 15:09:15 -0800	[thread overview]
Message-ID: <20201105230921.19017-10-paulmck@kernel.org> (raw)
In-Reply-To: <20201105230856.GA18904@paulmck-ThinkPad-P72>

From: Peter Zijlstra <peterz@infradead.org>

Kim reported that perf-ftrace made his box unhappy. It turns out that
commit:

  ff5c4f5cad33 ("rcu/tree: Mark the idle relevant functions noinstr")

removed one too many notrace qualifiers, probably due to there not being
a helpful comment.

This commit therefore reinstates the notrace and adds a comment to avoid
losing it again.

[ paulmck: Apply Steven Rostedt's feedback on the comment. ]
Fixes: ff5c4f5cad33 ("rcu/tree: Mark the idle relevant functions noinstr")
Reported-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 kernel/rcu/tree.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index a9b7c9a..aaed35e 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1093,8 +1093,11 @@ static void rcu_disable_urgency_upon_qs(struct rcu_data *rdp)
  * CPU can safely enter RCU read-side critical sections.  In other words,
  * if the current CPU is not in its idle loop or is in an interrupt or
  * NMI handler, return true.
+ *
+ * Make notrace because it can be called by the internal functions of
+ * ftrace, and making this notrace removes unnecessary recursion calls.
  */
-bool rcu_is_watching(void)
+notrace bool rcu_is_watching(void)
 {
 	bool ret;
 
-- 
2.9.5


  parent reply	other threads:[~2020-11-05 23:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 23:08 [PATCH tip/core/rcu 0/16] Miscellaneous fixes for v5.11 Paul E. McKenney
2020-11-05 23:09 ` [PATCH tip/core/rcu 01/16] rcu: Don't invoke try_invoke_on_locked_down_task() with irqs disabled paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 02/16] x86/smpboot: Move rcu_cpu_starting() earlier paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 03/16] rcu: Panic after fixed number of stalls paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 04/16] list.h: Update comment to explicitly note circular lists paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 05/16] rcu: Implement rcu_segcblist_is_offloaded() config dependent paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 06/16] rcu: Fix single-CPU check in rcu_blocking_is_gp() paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 07/16] rcu: Clarify nocb kthreads naming in RCU_NOCB_CPU config paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 08/16] rcu/tree: Add a warning if CPU being onlined did not report QS already paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 09/16] rcu/tree: Make struct kernel_param_ops definitions const paulmck
2020-11-05 23:09 ` paulmck [this message]
2020-11-05 23:09 ` [PATCH tip/core/rcu 11/16] rcu/tree: nocb: Avoid raising softirq for offloaded ready-to-execute CBs paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 12/16] rcu: Prevent lockdep-RCU splats on lock acquisition/release paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 13/16] rcu: Fix a typo in rcu_blocking_is_gp() header comment paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 14/16] rcu: Do not report strict GPs for outgoing CPUs paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 15/16] rcu/tree: Defer kvfree_rcu() allocation to a clean context paulmck
2020-11-05 23:09 ` [PATCH tip/core/rcu 16/16] srcu: Take early exit on memory-allocation failure paulmck

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=20201105230921.19017-10-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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