Date: Fri, 27 Feb 1998 10:25:55 -0600 From: Jonathan Lemon <jlemon@americantv.com> To: Eivind Eklund <eivind@yes.no> Cc: fs@FreeBSD.ORG Subject: Re: syncer / SMP question Message-ID: <19980227102555.05064@right.PCS> In-Reply-To: <19980227164859.25557@follo.net>; from Eivind Eklund on Feb 02, 1998 at 04:48:59PM %2B0100 References: <19980227164859.25557@follo.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980227102555.05064>