diff options
author | kib <kib@FreeBSD.org> | 2015-10-16 20:51:25 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-10-16 20:51:25 +0000 |
commit | 100b6d1e0ff25621059426d29ff806dc5fbe6fc6 (patch) | |
tree | 33d1a00e2d3965ada85d06a0ef5614c6f356acdb /sys/kern/kern_exit.c | |
parent | 68f48c5dee1151dcf082ec50b323bb5c7373463e (diff) | |
download | FreeBSD-src-100b6d1e0ff25621059426d29ff806dc5fbe6fc6.zip FreeBSD-src-100b6d1e0ff25621059426d29ff806dc5fbe6fc6.tar.gz |
MFC r289026:
Enforce the maxproc limitation before allocating struct proc.
In collaboration with: pho
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r-- | sys/kern/kern_exit.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 8846ae4..f2a61ad 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -957,9 +957,7 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options) KASSERT(FIRST_THREAD_IN_PROC(p), ("proc_reap: no residual thread!")); uma_zfree(proc_zone, p); - sx_xlock(&allproc_lock); - nprocs--; - sx_xunlock(&allproc_lock); + atomic_add_int(&nprocs, -1); } static int |