From owner-p4-projects@FreeBSD.ORG Wed Mar 16 22:26:45 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B42E916A4D0; Wed, 16 Mar 2005 22:26:44 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7063816A4CE for ; Wed, 16 Mar 2005 22:26:44 +0000 (GMT) Received: from mail22.sea5.speakeasy.net (mail22.sea5.speakeasy.net [69.17.117.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CCC543D39 for ; Wed, 16 Mar 2005 22:26:44 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 13351 invoked from network); 16 Mar 2005 22:26:44 -0000 Received: from server.baldwin.cx ([216.27.160.63]) (envelope-sender )AES256-SHA encrypted SMTP for ; 16 Mar 2005 22:26:43 -0000 Received: from [10.50.40.202] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id j2GMQZmd002096; Wed, 16 Mar 2005 17:26:36 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Jake Burkholder Date: Wed, 16 Mar 2005 16:17:34 -0500 User-Agent: KMail/1.6.2 References: <200503032211.j23MBlia013010@repoman.freebsd.org> <4234CA9D.9080108@locore.ca> In-Reply-To: <4234CA9D.9080108@locore.ca> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200503161617.34804.jhb@FreeBSD.org> X-Spam-Status: No, score=-102.8 required=4.2 tests=ALL_TRUSTED, USER_IN_WHITELIST autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx cc: Perforce Change Reviews Subject: Re: PERFORCE change 72454 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2005 22:26:45 -0000 On Sunday 13 March 2005 06:19 pm, Jake Burkholder wrote: > John Baldwin wrote: > >http://perforce.freebsd.org/chv.cgi?CH=72454 > > > >Change 72454 by jhb@jhb_slimer on 2005/03/03 22:11:16 > > > > Clobber all memory for atomic ops with an acquire barrier. > > > > Suggested by: alc > > > >Affected files ... > > > >.. //depot/projects/smpng/sys/sparc64/include/atomic.h#7 edit > > > >Differences ... > > > >==== //depot/projects/smpng/sys/sparc64/include/atomic.h#7 (text+ko) ==== > > > >@@ -90,6 +90,7 @@ > > itype(sz) v; \ > > v = atomic_cas(p, e, s, sz); \ > > membar(LoadLoad | LoadStore); \ > >+ __asm __volatile("" : : : "memory"); \ > > v; \ > > }) > > > >@@ -115,6 +116,7 @@ > > itype(sz) t; \ > > t = atomic_op(p, op, v, sz); \ > > membar(LoadLoad | LoadStore); \ > >+ __asm __volatile("" : : : "memory"); \ > > t; \ > > }) > > > >@@ -132,6 +134,7 @@ > > itype(sz) v; \ > > v = atomic_load(p, sz); \ > > membar(LoadLoad | LoadStore); \ > >+ __asm __volatile("" : : : "memory"); \ > > v; \ > > }) > > membar already has a memory clobber fwiw. It does on ppc, too, I'm not sure if I should remove them from there. The problem is that "memory" is a notice to gcc to not store values across an instruction, but just because we order writes doesn't mean that gcc needs to throw out values. Only an 'acq' membar really has that requirement. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org