Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Aug 1998 13:12:03 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        freebsd-fs@FreeBSD.ORG
Cc:        dillon@backplane.com
Subject:   Filesystem locking during lookups
Message-ID:  <199808061712.NAA14470@khavrinen.lcs.mit.edu>

next in thread | raw e-mail | index | archive | help
I ran a modified kernel whose lookup() only uses exclusive locks for
CREATE and DELETE namei operations yesterday.  So far as I can tell,
this is a perfectly reasonable thing to do.  However, it does
seriously unbalance the relative priorities of lookups vis-a-vis
deletes, and this might be considered a security issue.  A more
complete implementation would use shared locks all the time, and then
upgrade to exclusive only when actually necessary.

One particular side-effect of this change is that my five-minute
dexpire took an hour and a half yesterday noon.  I believe this
effectively rebuts Matt Dillon's contention that the vfs name cache
will prevent problems of lock contention.  (And indeed, if one
inspects the code, it is clear that the vnode has to locked first,
since the name cache is called by VOP_LOOKUP, which requires a locked
vnode.)

In 30 seconds, my machine made 1475 calls to namei, of which 209 were
root-relative.  Even with these changes, my machine still deadlocked
last night (although it lasted longer than it did the night before),
so I would say that there is a fair amount of filesystem contention
going on.

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
wollman@lcs.mit.edu  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick

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?199808061712.NAA14470>