1 Apr 2006 06:30
Re: [PATCH 2/4] locks: don't unnecessarily fail posix lock operations
Trond Myklebust <trond.myklebust <at> fys.uio.no>
2006-04-01 04:30:50 GMT
2006-04-01 04:30:50 GMT
On Fri, 2006-03-31 at 21:46 +0200, Miklos Szeredi wrote:
> > > In the first case no new locks are needed. In the second, no locks
> > > are modified prior to the check.
> >
> > Consider something like
> >
> > fcntl(SETLK, 0, 100)
> > fcntl(SETLK, 0, 100)
> > fcntl(SETLK, 0, 100)
>
> Huh? What is the type of lock in each case.
>
> But anyway your example is no good. If the new lock completely covers
> the previous one, then the old lock will simply be adjusted and no new
> lock is inserted.
Slip of the mailer. It posted when I wanted to cancel the mail (I had to
step out for an errand)...
OK. I see what you mean now. Do you agree with the following analysis?
1) We need 2 extra locks for the case where we
upgrade/downgrade, a single existing lock and end up splitting
it.
2) We need to use 1 extra lock in the case where we unlock and
split a single existing lock.
3) We also need to use 1 extra lock in the case where there is
no existing lock that is contiguous with the region to lock.
(Continue reading)
RSS Feed