From owner-freebsd-current@FreeBSD.ORG Fri Aug 20 18:01:52 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2BDB616A4CE for ; Fri, 20 Aug 2004 18:01:52 +0000 (GMT) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id F214A43D2F for ; Fri, 20 Aug 2004 18:01:51 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 26311 invoked from network); 20 Aug 2004 18:01:51 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 20 Aug 2004 18:01:51 -0000 Received: from [10.50.40.208] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i7KI0fGg065473; Fri, 20 Aug 2004 14:01:48 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-current@FreeBSD.org Date: Fri, 20 Aug 2004 13:02:26 -0400 User-Agent: KMail/1.6.2 References: <4125B172.9060303@cronyx.ru> In-Reply-To: <4125B172.9060303@cronyx.ru> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408201302.26421.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Robert Watson cc: Roman Kurakin Subject: Re: Tracking down LORs X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2004 18:01:52 -0000 On Friday 20 August 2004 04:08 am, Roman Kurakin wrote: > Robert Watson wrote: > >On Fri, 20 Aug 2004, Roman Kurakin wrote: > >> Currently I am trying to track down a couple of LORS in my code. > >>But it seems that I do not undestand smth or all things id realy so bad. > > > >I find it's very helpful to add lock orders to the hard-coded lock order > >table in subr_witness.c. Without hard-coded entries, WITNESS will > >dynamically build an order based on observed lock use. This is generally > >fine, but once in a while the "wrong" order will be used before the > >"right" order, so the lock order warning will print for the "right" order, > >leaving less useful debugging information. The table allows the > >definition of partial orders, so you can specify relationships between > >subsets of mutexes of interest. WITNESS will flesh out remaining orders > >through dynamic discovery. > > I'll try to go this way, since I am in dead end. Note that some lock orders as also inferred via transitivity. For example, let's say you have three locks a, b, and c. One thread locks a then b, so witness saves that order. A second thread locks b then c, so witness saves that order. If a third thread tries to lock c then a, an LOR will result. This is similar to how > is transitive, i.e. if a > b and b > c, then a > c. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org