From owner-freebsd-arch Sun Jan 20 13:36:36 2002 Delivered-To: freebsd-arch@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id E54CA37B404 for ; Sun, 20 Jan 2002 13:36:30 -0800 (PST) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id IAA24755; Mon, 21 Jan 2002 08:36:29 +1100 (EDT) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37645) with ESMTP id <01KDBRS4AHSG5IJHWU@cim.alcatel.com.au>; Mon, 21 Jan 2002 08:36:46 +1100 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.6/8.11.6) id g0KLaQt63218; Mon, 21 Jan 2002 08:36:26 +1100 Content-return: prohibited Date: Mon, 21 Jan 2002 08:36:26 +1100 From: Peter Jeremy Subject: Re: 64 bit counters again In-reply-to: <200201202125.g0KLPqf31593@khavrinen.lcs.mit.edu>; from wollman@khavrinen.lcs.mit.edu on Sun, Jan 20, 2002 at 04:25:52PM -0500 To: Garrett Wollman Cc: Michal Mertl , arch@FreeBSD.ORG Mail-Followup-To: Garrett Wollman , Michal Mertl , arch@FreeBSD.ORG Message-id: <20020121083625.A72285@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: <3C48FCEF.9190CA08@mindspring.com> <200201202125.g0KLPqf31593@khavrinen.lcs.mit.edu> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-Jan-20 16:25:52 -0500, Garrett Wollman wrote: >The ultimate upshot of this is that it does not make sense to expose >low-level primitives (such as compare-exchange or LL/SC) directly in >the API. This is because each processor architecture will have its >own requirements for coherency, in some cases requiring specialized >instructions which a compiler would not normally generate, and often >requiring memory barriers inside the spin loop. Agreed. >However, we can easily define a set of basic operations which every >architecture we currently support can implement reliably and >coherently without locking, including incrementing counters and ^^^^^^^ protecting the operation by a separate mutex or semaphore-style lock. >updating some kinds of linked lists. Some form of inter-processor locking is required, but the low=level primitives implicitly achieve this. We already have a MI API for much of this in /sys//include/atomic.h Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message