From owner-svn-src-all@FreeBSD.ORG Thu May 24 22:15:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A57710656D0; Thu, 24 May 2012 22:15:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 658948FC16; Thu, 24 May 2012 22:15:17 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M4J00A00SHGYI00@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 17:15:16 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M4J006N6SHFFY10@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 17:15:16 -0500 (CDT) Date: Thu, 24 May 2012 17:15:15 -0500 From: Nathan Whitehorn In-reply-to: To: Marcel Moolenaar Message-id: <4FBEB2F3.4060405@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.24.220630, SenderIP=128.104.255.12 References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:15:17 -0000 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