From owner-freebsd-current@FreeBSD.ORG Fri Aug 6 08:30:07 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 5531616A4CE; Fri, 6 Aug 2004 08:30:07 +0000 (GMT) Received: from will.iki.fi (will.iki.fi [217.169.64.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15C2643D60; Fri, 6 Aug 2004 08:30:07 +0000 (GMT) (envelope-from will+freebsd-current@will.iki.fi) Received: from [10.0.20.162] (fa-3-0-0.fw.exomi.com [217.169.64.99]) by will.iki.fi (Postfix) with ESMTP id 80EC8B2; Fri, 6 Aug 2004 11:32:17 +0300 (EEST) Message-ID: <41134185.1090105@will.iki.fi> Date: Fri, 06 Aug 2004 11:29:57 +0300 From: Ville-Pertti Keinonen User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040708) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce M Simpson References: <20040805050422.GA41201@cat.robbins.dropbear.id.au> <200408051759.53079.jhb@FreeBSD.org> <4112B184.8010303@samsco.org> <20040806023055.GC20148@empiric.icir.org> In-Reply-To: <20040806023055.GC20148@empiric.icir.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 08:30:07 -0000 Bruce M Simpson wrote: >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. > > The idea of using self-modification to select locking modes (although for optional preemption, SMP and debugging rather than CPU model) is also described in a DEC Technical Journal article: http://research.compaq.com/wrl/DECarchives/DTJ/DTJF03/DTJF03SC.TXT I'm not sure whether the Linux implementation uses the same technique.