Re: [PATCH v4] tracepoint: Do not fail unregistering a probe due to memory failure

Steven Rostedt
2021-01-27T19:17:06Z

On Wed, 27 Jan 2021 13:13:22 -0500 (EST)
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:

> > Thanks for bringing that up.
>
> Requiring an RCU synchronize on element removal is quite intrusive, and can
> be problematic if tracepoint removal is called from e.g. preempt-off context.

But how often do you remove more than one callback from the same
tracepoint? Or should I say, from a lot of tracepoints?

This will only synchronize for the following case:

Add three callbacks to a single tracepoint.
Remove the first one.
<rcu callback to update the counters>
Remove the second one
<triggers a synchronization if the counters have not been finished
updating>
Remove the third one.
<no synchronization needed, because it's being freed>

And we may be able to make this work in batch too.

More to come, but I really like this approach over the others because it
does not increase the size of the kernel for a failure that should never
happen in practice.

-- Steve