From owner-freebsd-net@FreeBSD.ORG Thu Aug 18 14:31:24 2005 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E253B16A41F; Thu, 18 Aug 2005 14:31:24 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id A349E43D48; Thu, 18 Aug 2005 14:31:24 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id j7IEVOYw087693; Thu, 18 Aug 2005 07:31:24 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id j7IEVOQn087692; Thu, 18 Aug 2005 07:31:24 -0700 (PDT) (envelope-from rizzo) Date: Thu, 18 Aug 2005 07:31:24 -0700 From: Luigi Rizzo To: Stephan Uphoff Message-ID: <20050818073124.A87225@xorpc.icir.org> References: <20050816170519.A74422@xorpc.icir.org> <200508170435.34688.max@love2party.net> <20050817170248.A70991@xorpc.icir.org> <200508180332.34895.max@love2party.net> <20050818005739.A83776@xorpc.icir.org> <1124374713.1360.64660.camel@palm> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1124374713.1360.64660.camel@palm>; from ups@tree.com on Thu, Aug 18, 2005 at 10:18:33AM -0400 Cc: arch@freebsd.org, Max Laier , net@freebsd.org Subject: Re: duplicate read/write locks in net/pfil.c and netinet/ip_fw2.c X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2005 14:31:25 -0000 On Thu, Aug 18, 2005 at 10:18:33AM -0400, Stephan Uphoff wrote: > On Thu, 2005-08-18 at 03:57, Luigi Rizzo wrote: ... > > In fact i don't understand why you consider spinning and sleeping > > on a mutex two different things. > > The major difference between sleeping (cv_wait,msleep,..) and blocking > on a mutex is priority inheritance. > If you need to be able to use (non-spin) mutexes while holding a > [R|W]LOCK and use a [R|W]LOCK while holding a (non-spin) mutex then you > need to implement priority inheritance for [R|W]LOCKs. is that required (in FreeBSD, i mean) for algorithmic correctness or just for performance ? cheers luigi