From owner-freebsd-arch Tue Feb 19 17:38:20 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mail.chesapeake.net (chesapeake.net [205.130.220.14]) by hub.freebsd.org (Postfix) with ESMTP id 8FFD537B416 for ; Tue, 19 Feb 2002 17:38:17 -0800 (PST) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id g1K1cGB61138 for ; Tue, 19 Feb 2002 20:38:16 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Tue, 19 Feb 2002 20:38:16 -0500 (EST) From: Jeff Roberson To: arch@freebsd.org Subject: vnode issues & shared lock patch Message-ID: <20020219202000.M38875-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At BSDCon there were several discussions about problems with vnode locking, and vnodes in general. Some of the issues are related to code not following the vnode locking rules in various areas, and some are due to the lack of soft reference tracking. One painful example is vop_revoke. It may work or it may panic. Also, there are many reports of file system deadlocks. We came up with a list of items that could go towards addressing these issues. Namely the following: 1) Soft reference tracking through a refcount (or making use count more pervasive) 2) Full locking of the vnode structure, with well defined rules 3) Replacing the lockmgr lock with sx locks and re-evaluating kernel code which should acquire these locks. I'd like to get a group of people together who are interested or knowledgeable in this area. I already know of a few folks who have offered assistance, but I don't have a complete list. I also have a patch which allows users of the namei interface to request shared locks on leafs. This has been running in all of our kernels for 6 months without a deadlock. I have only modified stat and open to take advantage of this capability. The problem we were having is that an application would stat a file that had 60 seconds or so worth of IO pending, and it would block until that IO was finished because namei always grabs exclusive locks. The patch looks a little messy due to the inconsistencies in locking around the system. I have to do extra checking since I do upgrades and downgrades and the VOP calls don't always return vnodes in the advertised lock state. This is a good example of the problems generalized above. It is really a temporary fix for more serious problems that need to be addressed. The patch is available at http://www.chesapeake.net/~jroberson/sharedlock.patch Thanks, Jeff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message