Re: simplelocks in struct proc

Jason Thorpe <[email protected]> Mon, 3 Nov 2003 14:27:41 -0800
Newsgroups gmane.os.netbsd.devel.smp
Message-ID <[email protected]>
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 <[email protected]>