Re: [PATCH RFC v6 4/5] tracepoint: Make rcuidle tracepoint callers use SRCU

From: Joel Fernandes
Date: Tue May 08 2018 - 17:11:03 EST


On Mon, May 07, 2018 at 08:37:54PM -0400, Mathieu Desnoyers wrote:
> ----- On May 7, 2018, at 5:46 PM, Joel Fernandes, Google joel@xxxxxxxxxxxxxxxxx wrote:
>
> > On Mon, May 07, 2018 at 05:05:41PM -0400, Mathieu Desnoyers wrote:
> >> ----- On May 7, 2018, at 4:41 PM, Joel Fernandes joelaf@xxxxxxxxxx wrote:
> >> [...]
> >> > +extern struct srcu_struct tracepoint_srcu;
> >> > +
> >> > extern int
> >> > tracepoint_probe_register(struct tracepoint *tp, void *probe, void *data);
> >> > extern int
> >> > @@ -77,6 +80,9 @@ int unregister_tracepoint_module_notifier(struct
> >> > notifier_block *nb)
> >> > */
> >> > static inline void tracepoint_synchronize_unregister(void)
> >> > {
> >> > +#ifdef CONFIG_TRACEPOINTS
> >> > + synchronize_srcu(&tracepoint_srcu);
> >> > +#endif
> >> > synchronize_sched();
> >>
> >> Why is this ifdef needed ?
> >
> > tracepoint_srcu is defined in tracepoint.c so if we don't protect usage here, it
> > would cause a build error.
>
> Then we should ifdef the entire implementation of tracepoint_synchronize_unregister().
> There is no point in issuing synchronize_sched() when code invokes that
> function on a CONFIG_TRACEPOINTS=n config.

Ok I'll do it this way in the next rev. Could you also share any thoughts on
patch 6/6 if you had some time? Development of it has also been complete for
some time.

thanks,

- Joel