From owner-freebsd-hackers Tue Oct 16 19:23:35 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 8817937B43E; Tue, 16 Oct 2001 19:23:17 -0700 (PDT) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 427F114C40; Wed, 17 Oct 2001 04:23:16 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: John Baldwin Cc: dillon@freebsd.org, hackers@freebsd.org Subject: Re: Some questions regarding vfs / ffs References: From: Dag-Erling Smorgrav Date: 17 Oct 2001 04:23:15 +0200 In-Reply-To: Message-ID: Lines: 21 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG John Baldwin writes: > Not quite. You see, when we set the mount vnode pointer inside the > vnode, we get the mntvnode mutex while holding the vnode interlock, > so the order is thus vnode -> mntvnode. So, the ffs_sync() loop > can't lock the vnode while holding the mntvnode lock. It actually > used to do that. You're basically agreeing with me :) ffs_sync() releases the mntvnode lock early so it can grab the vnode lock, but if I'm right about it not needing the vnode lock yet at that point, it can gold the mntvnode lock longer - until after it's decided whether or not the vnode needs syncing - which means one less mntnode lock release / acquisition and one less vnode lock acquisition / release per non-dirty vnode, reducing the number of lock operations per vnode from four to nearly zero (as the ratio of dirty vnodes to clean vnodes is usually very low, the average number of lock operations per vnode examined will approach zero) 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