Re: [PATCH 1/1] Fix: trace sched switch start/stop racy updates
From: Herbert Xu
Date: Mon Sep 09 2019 - 02:22:23 EST
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> Paulmck actually has an example of that somewhere; ISTR that particular
> case actually got fixed by GCC, but I'd really _love_ for some compiler
> people (both GCC and LLVM) to state that their respective compilers will
> not do load/store tearing for machine word sized load/stores.
>
> Without this written guarantee (which supposedly was in older GCC
> manuals but has since gone missing), I'm loathe to rely on it.
IIRC in that case gcc actually broke atomic writes even with a
volatile keyword. So even WRITE_ONCE wouldn't have saved us.
Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt