Re: [PATCH bpf v4 1/1] bpf: Fix grace period wait for tracepoint bpf_link

Steven Rostedt
2026-03-31T21:22:23Z

On Tue, 31 Mar 2026 23:10:20 +0200
Kumar Kartikeya Dwivedi <memxor@gmail.com> wrote:

> diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
> index 22ca1c8b54f3..1d7f29f5e901 100644
> --- a/include/linux/tracepoint.h
> +++ b/include/linux/tracepoint.h
> @@ -122,6 +122,22 @@ static inline bool tracepoint_is_faultable(struct tracepoint *tp)
> {
> return tp->ext && tp->ext->faultable;
> }
> +/*
> + * Run RCU callback with the appropriate grace period wait for non-faultable
> + * tracepoints, e.g., those used in atomic context.
> + */
> +static inline void call_tracepoint_unregister_atomic(struct rcu_head *rcu, rcu_callback_t func)
> +{
> + call_srcu(&tracepoint_srcu, rcu, func);
> +}
> +/*
> + * Run RCU callback with the appropriate grace period wait for faultable
> + * tracepoints, e.g., those used in syscall context.
> + */
> +static inline void call_tracepoint_unregister_syscall(struct rcu_head *rcu, rcu_callback_t func)
> +{
> + call_rcu_tasks_trace(rcu, func);
> +}
> #else
> static inline void tracepoint_synchronize_unregister(void)
> { }
> @@ -129,6 +145,10 @@ static inline bool tracepoint_is_faultable(struct tracepoint *tp)
> {
> return false;
> }
> +static inline void call_tracepoint_unregister_atomic(struct rcu_head *rcu, rcu_callback_t func)
> +{ }
> +static inline void call_tracepoint_unregister_syscall(struct rcu_head *rcu, rcu_callback_t func)
> +{ }
> #endif
>

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve