From owner-freebsd-arch@FreeBSD.ORG Sun Nov 25 02:10:16 2007 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E04916A46E for ; Sun, 25 Nov 2007 02:10:16 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.freebsd.org (Postfix) with ESMTP id CA12B13C459 for ; Sun, 25 Nov 2007 02:10:15 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so253315nfb for ; Sat, 24 Nov 2007 18:10:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=khjeeNtRUFWQgFeXwWwFNyjp0twWJLZp9yKpYIu5EEw=; b=BpUzLNtfipnY5P5i5zH+eHfXmfiBdoTQfcG1TT0uUySVbssSFIaFJrvBaO3NvmAUSVgVpyoP6e+OTu/B+TbdXHV2IVWn4LFotp1eZRRro2OJmNxl+qYTQ0oYfTVvjV9JYD9AnOVkr5fUz5ag2suYdm4L2tyNQQpbUkVX6PzkjOg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=pzw08QQGgrREZRAnsZyRjxLrcCGfr/30RqjfuapvLgXTqES22t7ySR4g+opamKUN45iyxLQmsJTd9t2bfZXrDTWH5NxyvNCv6Feb3ufAFytKnvzqoCzxEAbHDcDJ8tcmx4w37ydFf6lwvxBABMMziqjjBvtPy7sDSrciqMf62VM= Received: by 10.86.49.13 with SMTP id w13mr1070069fgw.1195956606466; Sat, 24 Nov 2007 18:10:06 -0800 (PST) Received: by 10.86.28.19 with HTTP; Sat, 24 Nov 2007 18:10:06 -0800 (PST) Message-ID: <3bbf2fe10711241810o5b676b3ax330fda6a542b66da@mail.gmail.com> Date: Sun, 25 Nov 2007 03:10:06 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Robert Watson" In-Reply-To: <20071124162322.V14018@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071121222319.GX44563@elvis.mu.org> <20071123082339.GN44563@elvis.mu.org> <47469328.8020404@freebsd.org> <20071123092415.GP44563@elvis.mu.org> <4746F858.4070301@freebsd.org> <20071123235346.E14018@fledge.watson.org> <3bbf2fe10711231930m459dc800wbbb894b9fd50ca13@mail.gmail.com> <20071124103231.A14018@fledge.watson.org> <3bbf2fe10711240553k1eb35a5au23cae8af08f5864c@mail.gmail.com> <20071124162322.V14018@fledge.watson.org> X-Google-Sender-Auth: 45f18262a6e5f8c1 Cc: Stephan Uphoff , Max Laier , Alfred Perlstein , freebsd-arch@freebsd.org Subject: Re: rwlocks, correctness over speed. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2007 02:10:16 -0000 2007/11/24, Robert Watson : > On Sat, 24 Nov 2007, Attilio Rao wrote: > > >> I must have missed recursion arriving then -- I'll modify uipc_usrreq.c to > >> set the recursion flag on the rwlock in UNIX domain sockets rather than > >> doing the nasty hack that was previously required. At the time, the hack > >> was added because it seemed recursion was not going to be added to rwlocks, > >> but sonewconn() behavior for listen sockets really ended up requiring it. > > > > attilio 2007-06-26 21:31:56 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/kern kern_rwlock.c > > sys/sys _rwlock.h rwlock.h > > Log: > > Introduce a new rwlocks initialization function: rw_init_flags. > > This is very similar to sx_init_flags: it initializes the rwlock using > > special flags passed as third argument (RW_DUPOK, RW_NOPROFILE, > > RW_NOWITNESS, RW_QUIET, RW_RECURSE). > > Among these, the most important new feature is probabilly that rwlocks > > can be acquired recursively now (for both shared and exclusive paths). > > Yes, that was four months after I added rw_wowned(9) to work around the lack > of recursion support. :-) However, it looks like the man page was never > updated? It contains the following rather explicit language: > > Another important property is that shared holders of rwlock can recurse, > but exclusive locks are not allowed to recurse. Ok, fix committed. Thanks to you and Skip for the report. Attilio -- Peace can only be achieved by understanding - A. Einstein