From owner-freebsd-smp Thu Dec 14 9:59:25 2000 From owner-freebsd-smp@FreeBSD.ORG Thu Dec 14 09:59:23 2000 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 0ECEA37B400 for ; Thu, 14 Dec 2000 09:59:23 -0800 (PST) Received: from foo.osd.bsdi.com (root@foo.osd.bsdi.com [204.216.28.137]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id eBEHxCE76817; Thu, 14 Dec 2000 09:59:12 -0800 (PST) (envelope-from jhb@foo.osd.bsdi.com) Received: (from jhb@localhost) by foo.osd.bsdi.com (8.11.1/8.11.0) id eBEHwPI39568; Thu, 14 Dec 2000 09:58:25 -0800 (PST) (envelope-from jhb) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3A38E440.B89DA298@elischer.org> Date: Thu, 14 Dec 2000 09:58:20 -0800 (PST) Organization: BSD, Inc. From: John Baldwin To: Julian Elischer Subject: RE: Mutex roadmap Cc: smp@FreeBSD.ORG Sender: jhb@foo.osd.bsdi.com Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 14-Dec-00 Julian Elischer wrote: > In my attempts to understand locking on behaplf of netgraph, I > ended up writing up this little roadmap of where things are... > > In the hope that SOMEONE finds it useful, I'm posting it here. Some corrections: :) > ============== Macros that implement assembler locking primatives ==== > I'm not sure where these are used (I couldn't find any users). > Or if they are compatible with the other stuff... are they coming of going? MTX_EXIT is used in fork_trampoline() on the x86, and in switch_trampoline() on the alpha and ia64. This specific instance of MTX_EXIT will hopefully be moved out to a MI C function fork_trampoline() that returns to a very short MD stub fork_return in asm. > MTX_ENTER() Macro for non recursive spinlocks. (appears unused) > alpha/include/mutex.h > ia64/include/mutex.h > i386/include/mutex.h Just say 'machine/mutex.h', as it is more concise. :) > ========= Standard MI atomic ops. Defined per processor.============== > atomic stuff defined in {ia64,alpha,i386}/include/atomic.h > largely by macros tha produce inline asm functions. > only i386 examples detailed here. > Note that on the alpha "compare and set" is quite expensive > as it takes about 10 instructions. maybe we should use a different > primative.. On the alpha all of the atomic ops are built from checked loads and conditional stores. It's a RISC chip and doesn't have a 'semaphore' instruction like 'cmpxchg' or 'fetchadd' AFAIK. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message