Re: patch for 2.1.55 fs/locks.c

Andrew Walker (andy@lysaker.kvaerner.no)
Tue, 23 Sep 1997 12:28:56 +0200 (MET DST)


Bill Hawes wrote:
>
> I've been reviewing the fs/locks code and have put together a patch with
> a few proposed changes. As I'm not very familiar with file locking, I'd
> like to get some comments and suggestions on the patch. The patch makes
> no changes to locking policy.
>
> The main improvement is to obviate the need for atomic allocations by
> allocating the file_lock structures in advance. This turned out to be
> surprisingly easy to do, and actually simplified the error handling.
> Eliminating atomic allocations should improve system stability for
> applications doing a lot of locking under low memory situations.
>
> The other changes include fixes for a couple of minor races, and some
> shuffling of code to reduce error cleanup code.
>
> I'm not sure what software makes a good test case for file locking, so
> maybe someone has some ideas here.
>
> Regards,
> Bill

My initial scan of the patch suggests that it does no harm and a lot
of good. I'll try to test things a bit tonight but I don't expect any
surprises.

As far as the notifier function not blocking goes - I think we can
just make that a requirement. So far only the lockd implementation
in NFS uses it. I haven't actually checked to see if it can block.
Olaf Kirch is your man for NFS.

Sendmail/procmail/netscape mail etc. is usually a good test of "normal"
locking behaviour, although it doesn't exactly stress the race conditions.

-Andy

-- 
Andy Walker                              Kvaerner Engineering a.s.
Andrew.Walker@lysaker.kvaerner.no        P.O. Box 222, N-1324 Lysaker, Norway

......if the answer isn't violence, neither is your silence......

(pwei barmy army - oslo "filial")