From owner-freebsd-smp Fri Apr 27 11: 2: 5 2001 Delivered-To: freebsd-smp@freebsd.org Received: from smtp10.phx.gblx.net (smtp10.phx.gblx.net [206.165.6.140]) by hub.freebsd.org (Postfix) with ESMTP id A2CB937B423; Fri, 27 Apr 2001 11:02:02 -0700 (PDT) (envelope-from tlambert@usr07.primenet.com) Received: (from daemon@localhost) by smtp10.phx.gblx.net (8.9.3/8.9.3) id LAA47280; Fri, 27 Apr 2001 11:02:01 -0700 Received: from usr07.primenet.com(206.165.6.207) via SMTP by smtp10.phx.gblx.net, id smtpdfX8Taa; Fri Apr 27 11:01:54 2001 Received: (from tlambert@localhost) by usr07.primenet.com (8.8.5/8.8.5) id LAA02107; Fri, 27 Apr 2001 11:03:09 -0700 (MST) From: Terry Lambert Message-Id: <200104271803.LAA02107@usr07.primenet.com> Subject: Re: that vm diff now makes it into single user mode. To: bright@wintelcom.net (Alfred Perlstein) Date: Fri, 27 Apr 2001 18:03:08 +0000 (GMT) Cc: smp@FreeBSD.ORG, dillon@FreeBSD.ORG, jhb@FreeBSD.ORG In-Reply-To: <20010427042619.W18676@fw.wintelcom.net> from "Alfred Perlstein" at Apr 27, 2001 04:26:19 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Getting into UFS is starting to get somewhat hairy as there seems > like there's going to be a lock of lock/unlock or places where the > lock is held for a long period. FWIW: The correact approach to this is to lock the vnode, and treat everything lower than that as "opaque". If you can lock the vnode, you can make any call you want on it. Part of the problem here os some of the earlier "clean up" work that damaged the VFS interface. Really, the locks need to be asserted in the VOP_* macro, prior to calldown, and the locks need to be reentrant for the time being, for the same VFS. The easiest way to do this is to realize that there is no tail call optimization in the VFS code, _anywhere_, and just say "VOP_* calls from outside the VFS must lock the vnode, and VOP_* calls from withing the VFS must not, since the vnode will already be locked, UNLESS it is an internally acquired vnode that didn't come down from outside the VFS code". A gross approximation of this would be to put locks in all the VOP_ calls, and then pass a "do_lock" flag to all of them which is always "1" for code above the VFS layer (e.g. /sys/kerne/vfs_*.c), and _only occasionally_ "1" for calls from within the VFS layer (mostly "rename", "lookup", "delete", and other directory entry manipulation code in UFS, proper). You will need to "punt" on multithreading each VFS itself, until some later date (the only thing you will lose when doing this is the ability go into the same directory simultaneously on more than one processor). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message