From owner-freebsd-fs Fri Feb 27 08:26:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA13525 for freebsd-fs-outgoing; Fri, 27 Feb 1998 08:26:33 -0800 (PST) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from sumatra.americantv.com (sumatra.americantv.com [207.170.17.37]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA13500 for ; Fri, 27 Feb 1998 08:26:29 -0800 (PST) (envelope-from jlemon@americantv.com) Received: from right.PCS (right.PCS [148.105.10.31]) by sumatra.americantv.com (8.8.5/8.8.5) with ESMTP id KAA22559; Fri, 27 Feb 1998 10:26:27 -0600 (CST) Received: (from jlemon@localhost) by right.PCS (8.6.13/8.6.4) id KAA23915; Fri, 27 Feb 1998 10:25:56 -0600 Message-ID: <19980227102555.05064@right.PCS> Date: Fri, 27 Feb 1998 10:25:55 -0600 From: Jonathan Lemon To: Eivind Eklund Cc: fs@FreeBSD.ORG Subject: Re: syncer / SMP question References: <19980227164859.25557@follo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61.1 In-Reply-To: <19980227164859.25557@follo.net>; from Eivind Eklund on Feb 02, 1998 at 04:48:59PM +0100 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Feb 02, 1998 at 04:48:59PM +0100, Eivind Eklund wrote: > I was looking at implementing an incremental syncer for UFS, as a sort > of "let's get to know the FS-code" project, and noticed something that > looked like really strange code in the sync() syscall. Is there any > reason why the below wouldn't be a benign change? The extra > simplelock-call looks especially weird - it looks like either the lock > is released somewhere else, or we'll have the mountlist locked many > times. It appears to be released. The vfs_busy() routine makes a call to lockmgr(), which sets a lock on mountpoint and releases the lock on the mountlist. I agree that the lock calls look weird. Perhaps someone could explain the purpose of the various locks? It appears that you need to get a lock on the mountlist in order to iterate the mountpoints. But why does vfs_busy() (which operates on a mountpoint) release your mountlist lock? Convenience? (Yes, I know that simple_lock is only for SMP, but still...) As for hoisting up the calculation of nmp, I don't think you can do that, since the inner portion releases it's lock on the mountlist, meaning that the another processor can change the mountlist out from underneath you, invalidating your (saved) nmp. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message