All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: sashiko-reviews@lists.linux.dev, sashiko-bot@kernel.org,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] fprobe: Protect fprobe_return() with guard(rcu)()
Date: Wed, 30 Sep 2026 08:30:41 +0900	[thread overview]
Message-ID: <20260930083041.69ae294f887dd22c919e9cc4@kernel.org> (raw)
In-Reply-To: <20260929153906.6b1f9c29@fedora>

On Tue, 29 Sep 2026 15:39:06 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Mon, 28 Sep 2026 21:22:51 +0900
> Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> 
> > 
> > Hm, OK. Maybe we need to add something like checking rcu_watching, but
> > FTRACE_OPS_FL_RCU does not work correctly because fgraph_init_ops() only
> > configures subops (gops->ops). ftrace_startup_subops() does not propagete
> > that flag to graph_ops. (I guess that is yet another problem?)
> > 
> > To guarantee no illegal RCU usage or lockdep splats if an instrumented
> > function returns while RCU is offline, we can check 
> > 
> >  if (unlikely(!rcu_is_watching()))
> > 	return;
> 
> If rcu isn't watching then that is a bug.

Yeah, I made another fix for this bug.

https://lore.kernel.org/all/179064115227.394389.16910234241400391996.stgit@devnote2/

> 
> If you enable CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING then the
> ftrace_test_recursion_trylock() tests for rcu_is_watching(). We
> actually had that as default for some time to trigger any ftrace calls
> that were outside of RCU watching and was fixed.
> 
> Perhaps we need to enable that on more test machines to see if anything
> came back and allowed ftrace to trigger without it watching?

What about adding that config to tools/testing/selftests/ftrace/config?

Thank you,

> 
> -- Steve


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  reply	other threads:[~2026-09-29 23:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  0:35 [PATCH] fprobe: Protect fprobe_return() with guard(rcu)() Masami Hiramatsu (Google)
2026-09-28  0:35 ` Masami Hiramatsu (Google)
2026-09-28  0:51   ` sashiko-bot
2026-09-28 12:22     ` Masami Hiramatsu
2026-09-29 19:39       ` Steven Rostedt
2026-09-29 23:30         ` Masami Hiramatsu [this message]
2026-09-28 16:10   ` Paul E. McKenney
2026-09-29  0:13     ` Masami Hiramatsu

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=20260930083041.69ae294f887dd22c919e9cc4@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sashiko-bot@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.