aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
commit0cddd8f02397756cbeca5c5777d5895f3e419d88 (patch)
tree7420cce169451a74c5b87963467a4aeff668ed12 /sys/kern/kern_fork.c
parentd68b700a78ba6d4f1436aa6d21e47378a00a439b (diff)
downloadsrc-0cddd8f02397756cbeca5c5777d5895f3e419d88.tar.gz
src-0cddd8f02397756cbeca5c5777d5895f3e419d88.zip
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
Notes
Notes: svn path=/head/; revision=79224
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index dd3eb04e157a..9eecbc28c1f9 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -209,6 +209,8 @@ fork1(p1, flags, procp)
struct forklist *ep;
struct filedesc *fd;
+ GIANT_REQUIRED;
+
/* Can't copy and clear */
if ((flags & (RFFDG|RFCFDG)) == (RFFDG|RFCFDG))
return (EINVAL);
@@ -218,9 +220,7 @@ fork1(p1, flags, procp)
* certain parts of a process from itself.
*/
if ((flags & RFPROC) == 0) {
-
vm_fork(p1, 0, flags);
- mtx_assert(&vm_mtx, MA_NOTOWNED);
/*
* Close all file descriptors.
@@ -561,7 +561,6 @@ again:
* execution path later. (ie: directly into user mode)
*/
vm_fork(p1, p2, flags);
- mtx_assert(&vm_mtx, MA_NOTOWNED);
if (flags == (RFFDG | RFPROC)) {
cnt.v_forks++;