Re: [PATCH -v5 12/17] x86/kprobes: Fix ordering

Peter Zijlstra
2019-11-14T15:43:27Z

On Thu, Nov 14, 2019 at 10:30:01AM -0500, Mathieu Desnoyers wrote:
> ----- On Nov 14, 2019, at 10:28 AM, Peter Zijlstra peterz@infradead.org wrote:

> > I don't think that is needed. As per the patch under discussion, we
> > unconditionally need that IPI-sync (even for !optimized) but we only
> > need the synchonize_rcu_tasks() thing for optimized kprobes.
> >
> > Also, they really do two different things. Lets not tie them together.
>
> I'm fine with this approach, I just thought it would be good to consider
> the alternative.

Fair enough; I also just remembered we use synchronize_rcu_tasks() in
scenarios where we don't need to IPI-sync, for instrance when freeing
ftrace trampolines. There we just want to make sure nothing is still
preempted inside the trampoline when we free it -- which would be BAD
:-)