From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 17 19:00:32 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 772B816A41F; Tue, 17 Jan 2006 19:00:32 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FB1743D48; Tue, 17 Jan 2006 19:00:26 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id k0HJ0MKN011365; Tue, 17 Jan 2006 14:00:23 -0500 (EST) Date: Tue, 17 Jan 2006 14:00:22 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: John Baldwin In-Reply-To: <200601171311.20570.jhb@freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-hackers@freebsd.org, prime , kamalp@acm.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: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2006 19:00:32 -0000 On Tue, 17 Jan 2006, John Baldwin wrote: > On Monday 16 January 2006 00:08, Kamal R. Prasad wrote: > > you mean, boosting the priority of a reader would be required to avoid > > priority inversion, but difficult to implement? > > > > regards > > -kamal > > > > On 1/14/06, John Baldwin wrote: > > > I think you just kind of punt and do a best effort. Trying to manage a > > > list > > > of current read lock holders would be a bit PITA. > > Yes. The actual boosting is rather simple, it's keeping track of who has read > locks that is ugly. Hmm, do you really care which or if all of the readers get their priority boosted? Can't you just boost the priority of [any] one of the readers, and when he releases the lock and the reader lock count is still positive, boost the priority of another reader? Keep doing this until all the current readers have released the lock. In a perfect world you'd like to boost all of the readers, but that's pretty hard without chaining together all the readers and allowing for nested locks. I'm assuming that this is only needed when a [higher priority] writer wants the read lock. -- DE