tech-kern archive

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

Re: lock coupling (was: Re: Cleaning up namei)



>> I'm not sure I understand what you're trying to prove.
> That no-lock-coupling is no worse (in terms of possible consistency
> violations) than lock-coupling, except perhaps for a couple corner
> cases of limited concern, and particularly so for lookups other than
> the final step or two before performing a "real" operation.

Hm.

As I understand lock coupling, it means (in this context) that, as you
walk a path, you hold each directory vnode locked until you have not
only looked up but also locked the next.  That is, you always hold at
least one lock and sometimes hold two locks.  No-lock-coupling, then,
means that you hold either zero or one lock for a path walk, except for
a few special cases such as DELETE lookup leaves.  (All of those are
not counting the shared lock implicit in holding a reference to a
vnode.)

Are those accurate?  I've been thinking about locking and haven't come
to any definite conclusions, but would like to make sure we're talking
about the same thing.

> [...exampels of locking issues...]

> I think it likely that a similar example can be cooked up for vnodes,
> but at the moment I don't feel inclined to prepare it.  Consider it
> an exercise for the reader. :-)

I think it probably requires either .. or symlinks, though.  Otherwise,
the strict tree hierarchy involved in a pathname walk makes it much
harder - impossible, I think - to come up with such an example.  You
may note that all your examples involved processing a list of objects
in both directions at once.

>> So, I've probably misunderstood something....
> Nah, just the context... that's a pretty good counterexample,
> actually.  It's just one for something I wasn't trying to prove. :-)

So, I would say, what I misunderstood is what it was you were trying to
prove. :)

/~\ The ASCII                           der Mouse
\ / Ribbon Campaign
 X  Against HTML               mouse%rodents.montreal.qc.ca@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index