tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Replace lockmgr for vnodes



On Sat Feb 02 2008 at 16:00:48 +0900, YAMAMOTO Takashi wrote:
> > On Tue, Jan 29, 2008 at 03:06:08PM +0900, YAMAMOTO Takashi wrote:
> >  > > No, they don't. In the long run I'm intending to fix at least the
> >  > > vnode locks, because IMO they should be interruptible, but that'll
> >  > > likely be a slow process.
> >  > 
> >  > i believe vnode locks should not be interruptible.
> > 
> > ok then...
> > 
> > My reasoning is that all sleeps should be interruptible where
> > reasonably possible, because it increases the chance of being able to
> > recover in a semi-controlled fashion from a big deadlock or other
> > similar situation. This is particularly true of locks that might be
> > held during I/Os that might go off and never come back, and also
> > particularly true of locks that are manipulated by bodgy code that has
> > a record of causing trouble. Both these cases apply to vnode locks.
> > Meanwhile, the worst case for recovery is rename, and I've just been
> > over that code and I don't anticipate serious problems.
> > 
> > Your turn :-)
> > 
> > -- 
> > David A. Holland
> > dholland%netbsd.org@localhost
> 
> - what making troubles in your examples are I/Os which never come back
>  and bodgy code.  they should be fixed instead of locks.

puffs solves the problem with the userspace fs component being able to
hijack kernel locks exactly by not trusting "I/O which never comes back".

> - interruptible locks are actually harder to manipulate correctly,
>  esp. for bodgy code. :)

There is also another problem with interruptible locks.  You cannot call
VOP_INACTIVE if you fail to lock and yet release the last reference
(ok, quite unlikely, but since we are talking about bodgy code ....).
puffs deals with this and non-returning I/O interestingly (grep for
"Barfbags" in puffs_msgif.c).

-- 
Antti Kantee <pooka%iki.fi@localhost>                     Of course he runs 
NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
    "la qualité la plus indispensable du cuisinier est l'exactitude"



Home | Main Index | Thread Index | Old Index