On Thu, Sep 01, 2011 at 09:56:25AM +0200, Paolo Bonzini wrote:
> On 09/01/2011 09:37 AM, Sasha Levin wrote:
> >>>  -#define wmb() __asm__ __volatile__("": : :"memory")
> >>>  + /* TODO: we may also need rmb()s.  It hasn't bitten us yet, but.. */
> >>>  + #define wmb() __sync_synchronize()
> >
> >That asm directive also implicitly provided a compiler barrier, I could
>                      ^^^^
> 
> only
> 
> >find whether __sync_synchronize() provides one as well.
> >
> >Any idea if it does?
> 
> Of course, __sync_synchronize() is a stronger barrier.  The asm is
> simply not a synchronization primitive.

Good to hear that confirmed, I hadn't checked myself.  But then a cpu
memory barrier primitive without a compiler barrier would be an insane
thing to have.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Reply via email to