summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-10-16 20:51:25 +0000
committerkib <kib@FreeBSD.org>2015-10-16 20:51:25 +0000
commit100b6d1e0ff25621059426d29ff806dc5fbe6fc6 (patch)
tree33d1a00e2d3965ada85d06a0ef5614c6f356acdb /sys/kern/kern_exit.c
parent68f48c5dee1151dcf082ec50b323bb5c7373463e (diff)
downloadFreeBSD-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.c4
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
OpenPOWER on IntegriCloud