From owner-cvs-all Fri Feb 9 11:15:53 2001 Delivered-To: cvs-all@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 47F6437B69C; Fri, 9 Feb 2001 11:14:37 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f19JCR354550; Fri, 9 Feb 2001 11:12:27 -0800 (PST) (envelope-from jhb@FreeBSD.org) 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: <20010209104215.H26076@fw.wintelcom.net> Date: Fri, 09 Feb 2001 11:14:16 -0800 (PST) From: John Baldwin To: Alfred Perlstein Subject: Re: cvs commit: src/sys/kern kern_exit.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 09-Feb-01 Alfred Perlstein wrote: > * John Baldwin [010209 10:18] wrote: >> jhb 2001/02/09 08:43:18 PST >> >> Modified files: >> sys/kern kern_exit.c >> Log: >> Release the proc lock around crfree() and uifree() in wait1(). It leads >> to >> a lock order violation, and since p is already a zombie at this point, >> I'm not sure that we even need all the locking currently in wait1(). > > My first question was: > How does this lead to a lock order violation? > > Then I realized it might be what happens if crfree/uifree call into > free() which in turn calls into Giant? > > It'd be helpful to explain in more detail what you found and fixed > along with how and why. I see everything but 'why' in detail and > if you want others to be able to get it right (or find a flaw in > your logic) you'll need to be more clear. Ok. I'm not entirely happy with it at hte moment. However, the lock order violation was that previously uidinfo was acquired before proc lock, but during wait1(), proc lock was acquired prior to call uifree(), and uifree() called uifind(), and the mtx_lock() of the uid hash table mutex triggered the cycle. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "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