kernel - Make most of the fork and exit paths MPSAFE
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 12 Feb 2011 22:20:09 +0000 (14:20 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 12 Feb 2011 22:20:09 +0000 (14:20 -0800)
commitb5c4d81fee4abb297f1e3c6e6514c4bfc3c68bc0
treeb0452017b0aca121f8a79be7fb00a79d15faa9e7
parent076dc4bb35ff784c459aea98a48700c3796d8e1f
kernel - Make most of the fork and exit paths MPSAFE

* Remove the MP lock from numerous system calls (mainly socket calls) that
  no longer need it.

* Use proc_token in a couple of places that still need work (instead of
  the MP lock).  For example, the process group (pgrp) and several places
  which call pfind() still need to use the proc_token.

* Use the per-process p->p_token in fork1(), exit1(), and lwp_exit().
  The critical portions of these paths now have significant concurrency.

* Use the per-process p->p_token when traversing p->p_children, primarily
  aiding the kern_wait() code.  So the wait*() system calls should now
  have significant concurrency.

* Change the fgetown() API to avoid certain races.

* Add M_ZERO to the struct filedesc_to_leader allocation for safety
  purposes.
20 files changed:
sys/dev/drm/drm_drv.c
sys/kern/kern_descrip.c
sys/kern/kern_exit.c
sys/kern/kern_fork.c
sys/kern/kern_ktrace.c
sys/kern/kern_proc.c
sys/kern/kern_sig.c
sys/kern/subr_log.c
sys/kern/sys_pipe.c
sys/kern/sys_socket.c
sys/kern/tty.c
sys/kern/uipc_syscalls.c
sys/net/bpf.c
sys/net/tap/if_tap.c
sys/net/tun/if_tun.c
sys/platform/pc32/i386/trap.c
sys/platform/pc64/x86_64/trap.c
sys/platform/vkernel/i386/trap.c
sys/platform/vkernel64/x86_64/trap.c
sys/sys/filedesc.h