From owner-freebsd-arch@FreeBSD.ORG Sat Nov 24 03:30:31 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 B992616A420 for ; Sat, 24 Nov 2007 03:30:31 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.187]) by mx1.freebsd.org (Postfix) with ESMTP id 6890E13C459 for ; Sat, 24 Nov 2007 03:30:31 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so9764nfb for ; Fri, 23 Nov 2007 19:30:30 -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=xYoaVLkZaHT5BT5+fCdCnQF3LQiVdWEeUKtwjsFZCX4=; b=Qsoqh/tHYaQu+ENuyiGsWU4fsN6fmlHF8uVgleyvL5l04BOsmeUyWQqpH4I6qPdxcU8wcH43maCBW+2tpoKKsGFvfbaFh66ISyxXP2HA1AUnWc/zWuBQWV/GVZGJh2haK7s/nMMfJqFwv4rLQx0LVUqiUYKE1XaWicVUS4D7e2M= 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=q6P8yb5WzHpcFtb4n7pqybcgAe8oEJ12qSREyITTowxkei3nc5Xh1XdUiAGAbfFgSx+HWNW+fGP5em9613PiXHcR2c6SXfQfDItOSU4YNjaHSY6vkbySv9H2NCCDKcswmawQV/dqEljVYiLYTIKysJjO3r9enA5ERhK6iwRIBtI= Received: by 10.86.98.18 with SMTP id v18mr56018fgb.1195875029942; Fri, 23 Nov 2007 19:30:29 -0800 (PST) Received: by 10.86.28.19 with HTTP; Fri, 23 Nov 2007 19:30:29 -0800 (PST) Message-ID: <3bbf2fe10711231930m459dc800wbbb894b9fd50ca13@mail.gmail.com> Date: Sat, 24 Nov 2007 04:30:29 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Robert Watson" In-Reply-To: <20071123235346.E14018@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> <200711221641.02484.max@love2party.net> <3bbf2fe10711220753u435ff4cbxa94d5b682292b970@mail.gmail.com> <200711221726.27108.max@love2party.net> <20071123082339.GN44563@elvis.mu.org> <47469328.8020404@freebsd.org> <20071123092415.GP44563@elvis.mu.org> <4746F858.4070301@freebsd.org> <20071123235346.E14018@fledge.watson.org> X-Google-Sender-Auth: 324b85c6f1f72a8c 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: Sat, 24 Nov 2007 03:30:31 -0000 2007/11/24, Robert Watson : > While I'm no great fan of recursion, the reality is that many of our kernel > subsystems are not yet ready to disallow recursion on locks. Take a look at > the cases where we explicitly enable recursive acquisition for mutexes--in > practice, most network stack mutexes are recursive due to the recursive > calling in the network stack. While someday I'd like to think we'll be able > to eliminate some of that, but it won't be soon since it requires significant > reworking of very complicated code. The current model in which recursion is > explicitly enabled only where still required seems to work pretty well for the > existing code, although it's hard to say yet in the code I've looked at > whether read recursion would be required--the situations I have in mind would > require purely write recursion. There's one case in the UNIX domain socket > code where we do a locked test and conditional lock/unlock with an rwlock for > exclusive locking because recursion isn't currently supported, and that's not > a usage I'd like to encourage more of. Oh, I just didn't notice this -- rwlock are only present in 7.0 and in 7.0 they support recursion in exclusive mode, so I'm not sure what do you mean with 'recursion isn't currently supported'. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein