Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2002 20:38:16 -0500 (EST)
From:      Jeff Roberson <jroberson@chesapeake.net>
To:        arch@freebsd.org
Subject:   vnode issues & shared lock patch
Message-ID:  <20020219202000.M38875-100000@mail.chesapeake.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020219202000.M38875-100000>