Re: [PATCH 1/4] tracing: Use the perf recursion protection fromtrace event

From: Peter Zijlstra
Date: Sun Nov 22 2009 - 06:25:27 EST


On Sun, 2009-11-22 at 12:22 +0100, Ingo Molnar wrote:

> > > +void perf_swevent_put_recursion_context(int *recursion)
> > > {
> > > - struct perf_cpu_context *cpuctx = &get_cpu_var(perf_cpu_context);
> > > - int *recursion = perf_swevent_recursion_context(cpuctx);
> > > - struct perf_event_context *ctx;
> > > -
> > > - if (*recursion)
> > > - goto out;
> > > + (*recursion)--;
> > > +}
> >
> > And here as well.
>
> Global functions are in essence a barrier() to GCC but yeah.

Can't rely on that, because if the thing decides to inline this function
it looses that barrier semantic.

And it being such a small function with a few callsites in the same
translation unit, there's a fair chance it will actually inline.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/