Date: 17 Oct 2001 03:11:57 +0200 From: Dag-Erling Smorgrav <des@ofug.org> To: hackers@freebsd.org Cc: dillon@freebsd.org Subject: Some questions regarding vfs / ffs Message-ID: <xzpsncjvzmq.fsf@flood.ping.uio.no>
next in thread | raw e-mail | index | archive | help
Why do we have a single mntvnode_mtx instead of one per struct mount? It's supposed to protect the (per-mount) vnode list, so logically it should be a per-mount mutex. The only reason I can find for it being global is that it saves a few keystrokes in insmntque(). This is the only place I've found where mntvnode_mtx is held and more than one mount is invloved. Why does ffs_sync() grab the vnode interlock before checking if the vnode is dirty? As far as I can determine (from comments in the headers), none of the information it examines is protected by the interlock. Are the comments wrong, or is the code wrong? If the code is wrong, then this is what is killing interrupt latency on my box: needlessly acquiring and releasing 40,000 or 60,000 vnode interlocks twice per minute. Also, ffs_sync() does a lot of locking and unlocking of mntvnode_mtx, when actually (I think) it could get away with just unlocking it briefly while actually syncing a vnode, and holding it the rest of the time. I believe the reason why it currently does what it does is to avoid a lock reversal between mntvnode_mtx and the vnode locks. This won't be a problem if I'm right about the vnode lock being held unnecessarily. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpsncjvzmq.fsf>