Re: [PATCH] fprobe: Use guard(rcu_sched_notrace) and check rcu_is_watching()
From: Masami Hiramatsu (Google)
Date: Thu Oct 01 2026 - 09:58:54 EST
On Wed, 30 Sep 2026 16:03:25 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> On Tue, 29 Sep 2026 09:19:12 +0900
> "Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx> wrote:
>
> > @@ -329,16 +333,14 @@ static void fprobe_ftrace_entry(unsigned long
> > ip, unsigned long parent_ip, struct fprobe *fp;
> > int bit;
> >
> > + if (!rcu_is_watching())
> > + return;
> > +
>
> I'm thinking these should really be:
>
> if (WARN_ON_ONCE(!rcu_is_watching()))
> return;
Hmm, is this for warning users to notice it is out of supported path?
If CONFIG_ARCH_WANTS_NO_INSTR=n, we will not prohibit user to set ftrace
avoiding the function where the RCU is not watching. So maybe it is hit
by user's operation.
Thank you,
>
> -- Steve
>
--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>