Re: [PATCH 1/1] Fix: trace sched switch start/stop racy updates

From: Peter Zijlstra
Date: Tue Aug 20 2019 - 10:01:58 EST


On Fri, Aug 16, 2019 at 09:52:17PM -0700, Paul E. McKenney wrote:
> On Fri, Aug 16, 2019 at 03:57:43PM -0700, Linus Torvalds wrote:
>
> [ . . . ]
>
> > We add READ_ONCE and WRITE_ONCE annotations when they make sense. Not
> > because of some theoretical "compiler is free to do garbage"
> > arguments. If such garbage happens, we need to fix the compiler, the
> > same way we already do with
> >
> > -fno-strict-aliasing
>
> Yeah, the compete-with-FORTRAN stuff. :-/
>
> There is some work going on in the C committee on this, where the
> theorists would like to restrict strict-alias based optimizations to
> enable better analysis tooling. And no, although the theorists are
> pushing in the direction we would like them to, as far as I can see
> they are not pushing as far as we would like. But it might be that
> -fno-strict-aliasing needs some upgrades as well. I expect to learn
> more at the next meeting in a few months.
>
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2364.pdf
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2363.pdf
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2362.pdf

We really should get the compiler folks to give us a
-fno-pointer-provenance. Waiting on the standards committee to get their
act together seems unlikely, esp. given that some people actually seem
to _want_ this nonsense :/