Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 May 2012 17:15:15 -0500
From:      Nathan Whitehorn <nwhitehorn@freebsd.org>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar <marcel@freebsd.org>, src-committers@freebsd.org
Subject:   Re: svn commit: r235931 - head/sys/powerpc/include
Message-ID:  <4FBEB2F3.4060405@freebsd.org>
In-Reply-To: <EEFFC9C4-7469-4D70-A5C6-7F5CB19CAC28@xcllnt.net>
References:  <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> <EEFFC9C4-7469-4D70-A5C6-7F5CB19CAC28@xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 05/24/12 17:07, Marcel Moolenaar wrote:
>
> On May 24, 2012, at 2:13 PM, Nathan Whitehorn wrote:
>
>> On 05/24/12 15:45, Marcel Moolenaar wrote:
>>> Author: marcel
>>> Date: Thu May 24 20:45:44 2012
>>> New Revision: 235931
>>> URL: http://svn.freebsd.org/changeset/base/235931
>>>
>>> Log:
>>>    Fix the memory barriers for CPUs that do not like lwsync and wedge or cause
>>>    exceptions early enough during boot that the kernel will do ithe same.
>>>    Use lwsync only when compiling for LP64 and revert to the more proven isync
>>>    when compiling for ILP32. Note that in the end (i.e. between revision 222198
>>>    and this change) ILP32 changed from using sync to using isync. As per Nathan
>>>    the isync is needed to make sure I/O accesses are properly serialized with
>>>    locks and isync tends to be more effecient than sync.
>>>
>>
>> This badly breaks the synchronization primitives. The functions mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync.
>
> I guess I misinterpreted your email in which you stated that isync is better.

It's just in this one single case. Otherwise, it's still faster but 
doesn't work :)

>> Summary:
>> 1. *mb() must be lwsync or sync on all machines, except for wmb() which could be eieio
>> 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with bus_space changes)
>> 3. __ATOMIC_REL() must be lwsync or sync
>
> This is absolutely not what I concluded from our discussions. I have no idea
> how we could end up so out of sync...
>

Thanks for the quick change. No idea how we got out of sync. I find all 
of this synchronization stuff a little mind-bending, so sorry for any 
miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, so 
I've fixed that up. Things should be good now.
-Nathan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FBEB2F3.4060405>