From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 18 16:31:25 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5132016A41F for ; Wed, 18 Jan 2006 16:31:25 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id D102943D6E for ; Wed, 18 Jan 2006 16:31:19 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: by zproxy.gmail.com with SMTP id 9so1665256nzo for ; Wed, 18 Jan 2006 08:31:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=brDQ+MXkd5ok7/97lgf3ZOMSwi7hmNlcdTMEGJcQ0HycmNrn6yDREpybEXrCFU0fyeMJYUk5qzYfIhbtZNrC6Q4AC4bhV6boUv2d/JmzVLkT4/5QbMRnFKf3bUmiIEWfGKnKW/iTnwCJlgBrJfGmVd18dSFzxtrDGhLZvr2Ioko= Received: by 10.36.39.5 with SMTP id m5mr6742768nzm; Wed, 18 Jan 2006 08:31:19 -0800 (PST) Received: by 10.36.43.4 with HTTP; Wed, 18 Jan 2006 08:31:19 -0800 (PST) Message-ID: <3bbf2fe10601180831r69dbf1f9j@mail.gmail.com> Date: Wed, 18 Jan 2006 17:31:19 +0100 From: rookie To: Daniel Eischen In-Reply-To: MIME-Version: 1.0 References: <3bbf2fe10601180715k25297666y@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: How priority propagation works on read/write lock? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rookie@gufi.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 16:31:25 -0000 2006/1/18, Daniel Eischen : > I assume we already know how to propagate priority for mutexes, so > once you know how to propagate for RWlocks, it all just works. As I can see, propagate priority for mutex needs a little modify to turnstiles code, that's not a great deal. > Yes, once you choose a thread to propagate, you have to keep > propagating through whatever it is blocked on or until you > reach a point where the propagated priority is <=3D the priority > of the next thread in the heirarchy. I never questioned that > part of it, just the need to do it for all threads owning the > RW lock at the same time. Maybe it's not "strictly" necessary but please consider that "blocking hierarchies" are never too long and a total priority propagation would be quicker (you however need to propagate to every owner in the end so doing i= t at the same time could craft a bottleneck if the hierarchy is too long, but it's a rare case and in the opposite way you need to rule 'what thread need= s to be update' every time a blocking thread is unblocked). Cheers, Attilio -- Peace can only be achieved by understanding - A. Einstein