diff options
author | peter <peter@FreeBSD.org> | 2004-03-14 01:48:32 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2004-03-14 01:48:32 +0000 |
commit | 963c36c1956c741c098e14e7f7708ac1d78e187e (patch) | |
tree | 7ac4a7d805b1c5a44a91fd02d5e0ca6eed22834e | |
parent | 066f7934c61f7a02e91c3b9ce60a2985e9a4c11a (diff) | |
download | FreeBSD-src-963c36c1956c741c098e14e7f7708ac1d78e187e.zip FreeBSD-src-963c36c1956c741c098e14e7f7708ac1d78e187e.tar.gz |
Move the process_fork event out from under Giant. This one is easy,
since there are no consumers in the tree. Document this.
-rw-r--r-- | sys/kern/kern_fork.c | 4 | ||||
-rw-r--r-- | sys/sys/eventhandler.h | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 03d12bb..bd17f05 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -689,14 +689,16 @@ again: cnt.v_rforkpages += p2->p_vmspace->vm_dsize + p2->p_vmspace->vm_ssize; } + mtx_unlock(&Giant); /* * Both processes are set up, now check if any loadable modules want * to adjust anything. * What if they have an error? XXX + * + * Handlers must be MPSAFE, or aquire Giant themselves if not. */ EVENTHANDLER_INVOKE(process_fork, p1, p2, flags); - mtx_unlock(&Giant); /* * Set the child start time and mark the process as being complete. diff --git a/sys/sys/eventhandler.h b/sys/sys/eventhandler.h index 19f19ba..3f623b2 100644 --- a/sys/sys/eventhandler.h +++ b/sys/sys/eventhandler.h @@ -156,7 +156,11 @@ typedef void (*vm_lowmem_handler_t)(void *, int); #define LOWMEM_PRI_DEFAULT EVENTHANDLER_PRI_FIRST EVENTHANDLER_DECLARE(vm_lowmem, vm_lowmem_handler_t); -/* Process events */ +/* + * Process events + * process_fork handlers are called without Giant. + * exit/exec handlers are called with Giant. + */ struct proc; typedef void (*exitlist_fn)(void *, struct proc *); |