Subject: Re: simplelocks in struct proc
To: David Laight <david@l8s.co.uk>
From: Jason Thorpe <thorpej@wasabisystems.com>
List: tech-smp
Date: 11/03/2003 14:27:41
On Monday, November 3, 2003, at 01:24  PM, David Laight wrote:

> Rather than add yet another simplelock, it would actually make more
> sense to have a single p_lock for quick(ish) operations on the
> proc structure.

It makes sense.

> It is also worth adding a short comment to indicate which lock applies
> to each field, eg:
>         int             p_nrlwps;       /* L: Number of running LWPs */

FreeBSD has recently done a lot of work on the locking protocol for 
proc structures; you might consider looking at what they have done.

In any case, I heartily encourage you to make changes that improve 
locking in the kernel (though, PLEASE discuss locking protocols on the 
appropriate tech-* list and document them thoroughly in the appropriate 
code/manpages :-)

         -- Jason R. Thorpe <thorpej@wasabisystems.com>