Re: [RFC PATCH v2 26/31] fprobe: Rewrite fprobe on function-graph tracer

Steven Rostedt
2023-11-11T01:44:29Z

On Fri, 10 Nov 2023 16:17:39 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:

> > + used = 0;
> > + hlist_for_each_entry_from_rcu(node, hlist) {
> > + if (node->addr != func)
> > + break;
> > + fp = READ_ONCE(node->fp);
> > + if (!fp || fprobe_disabled(fp))
> > + continue;
> > +
> > + if (fprobe_shared_with_kprobes(fp))
> > + ret = __fprobe_kprobe_handler(func, ret_ip,
> > + fp, fregs, fgraph_data + used);
> > + else
> > + ret = __fprobe_handler(func, ret_ip, fp,
> > + fregs, fgraph_data + used);
>
>
> Since the fgraph callback is under rcu-locked but not preempt-disabled,

rcu-locked? The only rcu-locked is task rcu.

> fprobe unittest fails. I need to add preempt_disable_notrace() and
> preempt_enable_notrace() around this. Note that kprobe_busy_begin()/end()
> also access to per-cpu variable, so it requires to disable preemption.

Just around the __fprobe_*handler()? Or the loop?

-- Steve