From owner-freebsd-arch@FreeBSD.ORG Thu Nov 22 15:53:36 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 C2B9416A46B for ; Thu, 22 Nov 2007 15:53:36 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.freebsd.org (Postfix) with ESMTP id 48C5413C4CC for ; Thu, 22 Nov 2007 15:53:36 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so2558576nfb for ; Thu, 22 Nov 2007 07:53:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; 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=rmtzPiFkYAjkG/NpD9Hib5+LqyWdyWkF91ARxdT+b2E=; b=Ycot668WxLFDLoktiVE1+Th8bYK9IUkDMyYg4AzqhO1xOo7J0RMWPmt5BDi4TlxSO7Kd/F7svna9jrl73KHhY8F+kUzvuoDikTt8f347klIxMQ/wIIqop5dYLkOVdNj6iezBdCBpoUJVZhbT6GN/DzyQCHDGUK8zpAD2IkM5Mys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; 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=rLGRkJ4yTLS1hrZ3oZHejKmKTb3OrUuc6zKccdyhI7uvYfWcNpZYMkeVRPN3CzEZQoUfJ9Sk7b45idIcFw56WCwchxQ92SJOCZ6DdUUlrvFKp5BpRIR0pftJDBPYNnqtpJRtpGGGkDc0SylC5Ad3gLe2/H1JYXgQ+U6wARZ0yo8= Received: by 10.86.36.11 with SMTP id j11mr8568111fgj.1195746808071; Thu, 22 Nov 2007 07:53:28 -0800 (PST) Received: by 10.86.28.19 with HTTP; Thu, 22 Nov 2007 07:53:28 -0800 (PST) Message-ID: <3bbf2fe10711220753u435ff4cbxa94d5b682292b970@mail.gmail.com> Date: Thu, 22 Nov 2007 16:53:28 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Max Laier" In-Reply-To: <200711221641.02484.max@love2party.net> 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> X-Google-Sender-Auth: eba5d8fe509ea2f1 Cc: Stephan Uphoff , 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: Thu, 22 Nov 2007 15:53:36 -0000 2007/11/22, Max Laier : > > rwlocks are already used in places that do recursive reads. The one place > I'm certain about is pfil(9) and we need a proper sollution for this. > Before rwlocks were used, I had a handrolled locking that supported both > read/write semantics and starvation avoidance - at the cost of failing to > allow futher read access when a writer asked for access. This however, > was quite application specific and not the most efficient implementation > either. I'm not a pfil(9) expert, but for what I've heard, rmlocks should be really good for it, shouldn't them? The concept is that if we want to maintain fast paths for rwlock we cannot do too much tricks there. And you can really deadlock if you allow recursion on readers... > If we were to disallow read recursion, we should have some generic lock > type that does allow it. rmlock(9)s seem to support full priority > propagation even for recursed readers. Can they be MFCed so that we have > an alternative? Are they considered ready for production? Should we > switch pfil(9) to them? It seems like a perfect match. I've not looked over rmlocks so much, but as they track readers they can do priority propagation (if it is not implemented, it could be done -- not sure about the cost of the operation though). Attilio -- Peace can only be achieved by understanding - A. Einstein