Re: [RFC 0/3] Revert SRCU from tracepoint infrastructure

From: Joel Fernandes
Date: Mon Feb 10 2020 - 12:17:10 EST


On Mon, Feb 10, 2020 at 05:36:52AM -0800, Paul E. McKenney wrote:
[snip]
> > The best we can do is move that rcu_irq_enter/exit_*() crud into the
> > perf tracepoint glue I suppose.
>
> One approach would be to define a synchronize_preempt_disable() that
> waits only for pre-existing disabled-preemption regions (including
> of course diabled-irq and NMI-handler regions. Something like Steve
> Rostedt's workqueue-baed schedule_on_each_cpu(ftrace_sync) implementation
> might work.
>
> There are of course some plusses and minuses:

Thanks for enlisting them.

> + Works on preempt-disable regions in idle-loop code without
> the need to invoke rcu_idle_exit() and rcu_idle_enter()..
>
> + Straightforward implementation.
>
> - Does not work on preempt-disable regions on offline CPUs.
> (I have no idea if this really matters.)

One more area where it would not work is, if in the future we made it
possible to sleep within tracepoint callbacks (something like what Mathieu
said about handling page faults properly in callback code), then such an
implementation would not work there.

thanks,

- Joel