From owner-freebsd-current Wed Mar 27 13:52: 4 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail17.speakeasy.net (mail17.speakeasy.net [216.254.0.217]) by hub.freebsd.org (Postfix) with ESMTP id ABE6137B417 for ; Wed, 27 Mar 2002 13:51:44 -0800 (PST) Received: (qmail 26085 invoked from network); 27 Mar 2002 21:51:43 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail17.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 27 Mar 2002 21:51:43 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g2RLqOv92802; Wed, 27 Mar 2002 16:52:24 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020326224745.GF93885@elvis.mu.org> Date: Wed, 27 Mar 2002 16:51:45 -0500 (EST) From: John Baldwin To: Alfred Perlstein Subject: Re: Lock order reversals in sys_pipe.c Cc: current@FreeBSD.org, Kris Kennaway Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 26-Mar-2002 Alfred Perlstein wrote: > * Alfred Perlstein [020326 14:43] wrote: >> * Kris Kennaway [020324 14:26] wrote: >> > The bento cluster is now running with WITNESS enabled to try and track >> > down some odd UMA lock corruption panics. Instead, it found the >> > following lock order reversal in sys_pipe.c overnight: >> > >> > Mar 24 09:02:29 gohan13 kernel: lock order reversal >> > Mar 24 09:02:29 gohan13 kernel: 1st 0xd99d6500 pipe mutex @ >> > /local0/scratch/usr/src/sys/kern/sys_pipe.c:450 >> > Mar 24 09:02:29 gohan13 kernel: 2nd 0xd971cddc process lock @ >> > /local0/scratch/usr/src/sys/kern/kern_sig.c:2093 >> > >> > Those source references are from a -current kernel from last night. >> >> Are you %100 on that? How did you get this to happen? >> >> I can see where I hold the pipe lock, then try to get a proc lock, >> but not the other way around... >> >> Any ideas? > > Note that I can pretty trivially fix this by dropping the pipe lock > while calling pgsigio in pipeselwakeup(), however I will then have to > make sure the callers of pipeselwakeup() can deal with someone else > mucking with the pipe during the call. > > Anyhow, wtf doesn't witness print out at least one instance of the > old locking? Basically let me know where locking is happening in > the other direction? That's easy to achieve. Add a static lock ordering in the compiled in arrays, then it will let you know when you do the other way. It may be an indirect relationship and not a direct one as well. The allproc/filedesc thing was an instance of indirect relationships determining the order. -- 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 freebsd-current" in the body of the message