On 11/01/2011 01:20 PM, David Miller wrote:
> Unfortunately, this is not true.
> 
> Otherwise we could change the 32-bit default code generation to
> v9 from v7 under Linux.

For v7, pa-risc, and sh, we originally allowed the test_and_set and
lock_release patterns to do non-obvious things with 0/1 constants.

My proposal is to *not* carry that over to the __atomic patterns.
The PA and SH targets have already switched to use kernel helpers,
and no longer rely on this hack.  The only one left is Sparc v7.

(1) Are there really live v7 still around?

    At least with v8 we have SWAP, with which we can implement the full
    __atomic_exchange pattern sans hackery.  We can't do that with just LDSTUB.

(2) Can we have the kernel implement some {SWAP,CAS}{4,8} primitives (possibly
    via a special trap) that we can export from libgcc, as we do for ARM, PA, & 
SH?

    I believe that would allow all of the non-embedded linux to support all of
    the c++11 atomic operations without having to resort to spinlocks.


r~

Reply via email to