From owner-freebsd-current@FreeBSD.ORG Fri Jan 16 12:23:06 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 3FD4F16A4D4 for ; Fri, 16 Jan 2004 12:23:06 -0800 (PST) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DFC243D4C for ; Fri, 16 Jan 2004 12:23:00 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 25781 invoked from network); 16 Jan 2004 20:23:00 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 16 Jan 2004 20:23:00 -0000 Received: from 10.50.40.206 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i0GKMfM8088743; Fri, 16 Jan 2004 15:22:55 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 16 Jan 2004 15:23:32 -0500 User-Agent: KMail/1.5.4 References: <200401161458.34197.jhb@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200401161523.32120.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: "Robin P. Blanchard" cc: current@freebsd.org Subject: Re: Panic with this morning's (~9am EDT, 15 jan 2004) sources. 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, 16 Jan 2004 20:23:06 -0000 On Friday 16 January 2004 03:09 pm, Dag-Erling Sm=F8rgrav wrote: > John Baldwin writes: > > You probably don't need to lock the new filedesc structure > > while you are creating it until you've actually hooked it up to a > > proc structure. > > Yes, I do. fdgrowtable() for instance asserts that the filedesc is > locked. Then do this: while (newfdp blah fdp) { FILEDESC_UNLOCK(fdp); FILEDESC_LOCK(newfdp); fd_growtable(newfdp); FILEDESC_UNLOCK(newfdp); FILEDESC_LOCK(fdp); } Since no other CPU or thread can possibly go near newfdp until it is hooked= =20 into a process, you don't need to worry about locking it other than to=20 satisfy assertions while you are constructing it. =2D-=20 John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =3D http://www.FreeBSD.org