From owner-freebsd-current@FreeBSD.ORG Fri Aug 6 17:46:48 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 766AE16A4CF for ; Fri, 6 Aug 2004 17:46:48 +0000 (GMT) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44F0543D2F for ; Fri, 6 Aug 2004 17:46:48 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 7516 invoked from network); 6 Aug 2004 17:46:47 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 6 Aug 2004 17:46:47 -0000 Received: from 10.50.40.208 (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i76HkJU9050210; Fri, 6 Aug 2004 13:46:45 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Scott Long Date: Fri, 6 Aug 2004 11:27:27 -0400 User-Agent: KMail/1.6 References: <20040805050422.GA41201@cat.robbins.dropbear.id.au> <200408051759.53079.jhb@FreeBSD.org> <4112FE79.4020007@samsco.org> In-Reply-To: <4112FE79.4020007@samsco.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408061127.27691.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: freebsd-current@FreeBSD.org cc: Tim Robbins Subject: Re: Atomic operations on i386/amd64 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2004 17:46:48 -0000 On Thursday 05 August 2004 11:43 pm, Scott Long wrote: > John Baldwin wrote: > > On Thursday 05 August 2004 01:04 am, Tim Robbins wrote: > >>Is there any particular reason why atomic_load_acq_*() and > >>atomic_store_rel_*() are implemented with CMPXCHG and XCHG instead of > >>MOV on i386/amd64 UP? > > > > Actually, using mov instead of lock xchg for store_rel reduced > > performance in some benchmarks Scott ran on an SMP machine, I'm guessing > > due to the higher latency of locks becoming available to other CPUs. I'm > > still waiting for benchmark results on UP to see if the change should be > > made under #ifndef SMP or some such. > > Your patch appears to slightly pessimize UP as well and SMP. Hmm, well so much for LOCK XCHG being evil then I guess. This points out that we should really benchmark the *FENCE changes to see if they help or hurt as well before committing them. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org