summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
committerdillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
commite028603b7e3e4fb35cdf00aab533f3965f4a13cc (patch)
tree7420cce169451a74c5b87963467a4aeff668ed12 /sys/kern/init_main.c
parent0b028660051eb7abf4306d34e7fec0e7fde86a28 (diff)
downloadFreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.zip
FreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.tar.gz
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.
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index aa1fa74..3859c5b 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -274,6 +274,8 @@ proc0_init(void *dummy __unused)
register struct filedesc0 *fdp;
register unsigned i;
+ GIANT_REQUIRED;
+
p = &proc0;
/*
@@ -373,14 +375,12 @@ proc0_init(void *dummy __unused)
limit0.p_refcnt = 1;
/* Allocate a prototype map so we have something to fork. */
- mtx_lock(&vm_mtx);
pmap_pinit0(vmspace_pmap(&vmspace0));
p->p_vmspace = &vmspace0;
vmspace0.vm_refcnt = 1;
vm_map_init(&vmspace0.vm_map, round_page(VM_MIN_ADDRESS),
trunc_page(VM_MAXUSER_ADDRESS));
vmspace0.vm_map.pmap = vmspace_pmap(&vmspace0);
- mtx_unlock(&vm_mtx);
p->p_addr = proc0paddr; /* XXX */
/*
@@ -471,6 +471,8 @@ start_init(void *dummy)
mtx_lock(&Giant);
+ GIANT_REQUIRED;
+
p = curproc;
/* Get the vnode for '/'. Set p->p_fd->fd_cdir to reference it. */
@@ -486,13 +488,11 @@ start_init(void *dummy)
* Need just enough stack to hold the faked-up "execve()" arguments.
*/
addr = trunc_page(USRSTACK - PAGE_SIZE);
- mtx_lock(&vm_mtx);
if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE,
FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0)
panic("init: couldn't allocate argument space");
p->p_vmspace->vm_maxsaddr = (caddr_t)addr;
p->p_vmspace->vm_ssize = 1;
- mtx_unlock(&vm_mtx);
if ((var = getenv("init_path")) != NULL) {
strncpy(init_path, var, sizeof init_path);
OpenPOWER on IntegriCloud