From owner-cvs-all Mon Feb 25 23: 9:44 2002 Delivered-To: cvs-all@freebsd.org Received: from mail11.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id A20A537B41C for ; Mon, 25 Feb 2002 23:09:32 -0800 (PST) Received: (qmail 3506 invoked from network); 26 Feb 2002 07:09:31 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([65.90.117.19]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 26 Feb 2002 07:09:31 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200202232056.g1NKuKf41350@apollo.backplane.com> Date: Tue, 26 Feb 2002 02:09:30 -0500 (EST) From: John Baldwin To: Matthew Dillon Subject: Re: cvs commit: src/sys/coda coda_venus.c src/sys/compat/linproc Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Seigo Tanimura , Alfred Perlstein Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 23-Feb-02 Matthew Dillon wrote: > >:Matt, any chance you can co-ordinate with jhb (or not) to add >:functionality to witness such that it can detect when a mutex >:is aquired while holding a pool mutex? >: >:-Alfred > > This would be very easy to do. Since witness already uses curthread > we simply have a field in curthread indicating that we are holding a > pool mutex. If witness_lock() sees this set then it complains. The > pool mutexes could be init'd with another MTX flag indicating that > they are leaf mutexes (i.e. MTX_LEAF). > > It is so easy it might be useful to do this test for INVARIANTS in > general without requiring WITNESS to be turned on. > > What do you think John? The problem is that you are using mutex pool locks for two different types of locks: real leaf locks that need lock order checks, and locks used to implement higher level primitives such as sx locks and lockmgr locks. These first locks need to be checked with witness, but the second do not. > -Matt > Matthew Dillon > -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message