Subject: CVS commit: syssrc
To: None <source-changes@netbsd.org>
From: Jason R Thorpe <thorpej@netbsd.org>
List: source-changes
Date: 07/22/1999 14:08:33
Module Name:	syssrc
Committed By:	thorpej
Date:		Thu Jul 22 21:08:32 UTC 1999

Modified Files:
	syssrc/sys/compat/svr4: svr4_misc.c
	syssrc/sys/kern: init_main.c kern_exit.c kern_fork.c kern_ktrace.c
	    kern_proc.c kern_resource.c kern_sig.c kern_synch.c kern_sysctl.c
	syssrc/sys/sys: proc.h

Log Message:
Add a read/write lock to the proclists and PID hash table.  Use the
write lock when doing PID allocation, and during the process exit path.
Use a read lock every where else, including within schedcpu() (interrupt
context).  Note that holding the write lock implies blocking schedcpu()
from running (blocks softclock).

PID allocation is now MP-safe.

Note this actually fixes a bug on single processor systems that was probably
extremely difficult to tickle; it was possible that schedcpu() would run
off a bad pointer if the right clock interrupt happened to come in the
middle of a LIST_INSERT_HEAD() or LIST_REMOVE() to/from allproc.


To generate a diff of this commit:
cvs rdiff -r1.78 -r1.79 syssrc/sys/compat/svr4/svr4_misc.c
cvs rdiff -r1.153 -r1.154 syssrc/sys/kern/init_main.c
cvs rdiff -r1.72 -r1.73 syssrc/sys/kern/kern_exit.c
cvs rdiff -r1.60 -r1.61 syssrc/sys/kern/kern_fork.c \
    syssrc/sys/kern/kern_synch.c
cvs rdiff -r1.35 -r1.36 syssrc/sys/kern/kern_ktrace.c
cvs rdiff -r1.32 -r1.33 syssrc/sys/kern/kern_proc.c
cvs rdiff -r1.50 -r1.51 syssrc/sys/kern/kern_resource.c
cvs rdiff -r1.90 -r1.91 syssrc/sys/kern/kern_sig.c
cvs rdiff -r1.48 -r1.49 syssrc/sys/kern/kern_sysctl.c
cvs rdiff -r1.79 -r1.80 syssrc/sys/sys/proc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.