From owner-freebsd-current@FreeBSD.ORG Fri Aug 6 08:31:30 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 8284E16A4CE; Fri, 6 Aug 2004 08:31:30 +0000 (GMT) Received: from itchy.rabson.org (mailgate.nlsystems.com [80.177.232.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id C913D43D3F; Fri, 6 Aug 2004 08:31:29 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from ns0.nlsystems.com (ns0.nlsystems.com [80.177.232.243]) by itchy.rabson.org (8.12.11/8.12.11) with ESMTP id i768VRXg035560; Fri, 6 Aug 2004 09:31:27 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: freebsd-current@freebsd.org Date: Fri, 6 Aug 2004 09:31:29 +0100 User-Agent: KMail/1.6.2 References: <20040805050422.GA41201@cat.robbins.dropbear.id.au> <4112B184.8010303@samsco.org> <20040806023055.GC20148@empiric.icir.org> In-Reply-To: <20040806023055.GC20148@empiric.icir.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408060931.29804.dfr@nlsystems.com> X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on itchy.rabson.org X-Virus-Scanned: clamd / ClamAV version 0.71, clamav-milter version 0.71 X-Virus-Status: Clean cc: Bruce M Simpson 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 08:31:30 -0000 On Friday 06 August 2004 03:30, Bruce M Simpson wrote: > On Thu, Aug 05, 2004 at 04:15:32PM -0600, Scott Long 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? > > Have a look at Linux. They ended up doing a runtime self-modifying > kernel hack so they could ship generic kernels which used the > appropriate locking instructions on each x86 family CPU. I also really like the way the kernel exports a page containing 'the best syscall sequence' for the current processor.