From owner-freebsd-current@FreeBSD.ORG Wed Nov 3 22:01:20 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3DEB1065693; Wed, 3 Nov 2010 22:01:20 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from out-0.mx.aerioconnect.net (outo.internet-mail-service.net [216.240.47.238]) by mx1.freebsd.org (Postfix) with ESMTP id 80FD68FC12; Wed, 3 Nov 2010 22:01:20 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id oA3M1J19029267; Wed, 3 Nov 2010 15:01:19 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 8C57D2D6012; Wed, 3 Nov 2010 15:01:18 -0700 (PDT) Message-ID: <4CD1DBAC.6050004@freebsd.org> Date: Wed, 03 Nov 2010 15:01:16 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: John Baldwin References: <4CD190EF.5080600@icyb.net.ua> <201011031317.36332.jhb@freebsd.org> <4CD1A14E.8060508@freebsd.org> In-Reply-To: <4CD1A14E.8060508@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: mdf@freebsd.org, freebsd-current@freebsd.org, Andriy Gapon Subject: Re: MTX_DEF versus MTX_SPIN X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 03 Nov 2010 22:01:20 -0000 On 11/3/10 10:52 AM, Julian Elischer wrote: > On 11/3/10 10:17 AM, John Baldwin wrote: >> On Wednesday, November 03, 2010 1:04:13 pm mdf@freebsd.org wrote: >>> >>> So a MTX_DEF is okay in that environment? >> Yes. In fact, the reason to have threads for interrupt handlers is >> to allow >> interrupt handlers to use non-spin locks that block when the lock >> is held. >> >> MTX_SPIN locks are generally not needed in device drivers. The >> only reason a >> driver would use one is if it used a filter handler which does not >> run in a >> threaded context. > oops a line got deleted I think.. > It should be noted that in the case where you really just want to > spin a few > instructions because some other thread is accessing a structure you > want, ... then the BTX_DEF code will spin for a short while before ... > descheduling you. so you don't always incur the scheduling overhead. > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" >