Add a sysctl and tunable kern.syscall_mpsafe which allows system calls
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 21 Nov 2005 21:59:52 +0000 (21:59 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 21 Nov 2005 21:59:52 +0000 (21:59 +0000)
commit270ac911b8afcc7f38dfcc85e279b3e40f5a9670
tree499a5ef08d4365ac29ac0fd07abba86b03b802cd
parente02941a71896ee0c5f8a7898a140177993eff34f
Add a sysctl and tunable kern.syscall_mpsafe which allows system calls
marked MPSAFE in syscalls.master to run without the MP lock.  This sysctl
is disabled (0) by default.

To make this work the userland scheduler's passive release / acquire code
had to be made MPSAFE.  The release code accomplishes this by using
atomic_*() ops to manipulate curprocmask and rdyprocmask.  The acquisition
code currently obtains the MP lock unconditionally.  The userland scheduler
really need to be rewritten to be cpu-localized.

Only a few system calls, such as getuid(), are currently marked MPSAFE.
No matter how a system call is marked, the MP lock is obtained
unconditionally when ktracing or signaling.
sys/emulation/linux/i386/linux_sysvec.c
sys/i386/i386/trap.c
sys/kern/kern_slaballoc.c
sys/kern/kern_sysmsg.c
sys/kern/sys_process.c
sys/kern/usched_bsd4.c
sys/platform/pc32/i386/trap.c
sys/sys/sysent.h