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

From: Steven Rostedt
Date: Wed Jan 27 2021 - 14:17:08 EST


On Wed, 27 Jan 2021 13:13:22 -0500 (EST)
Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> 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