diff options
author | trasz <trasz@FreeBSD.org> | 2015-04-29 10:23:02 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2015-04-29 10:23:02 +0000 |
commit | 802017a04b7fb1bc31576aa2de108cf67083c42c (patch) | |
tree | 59650c7275c65023f54e8bff435945b07bc2714a /sys/kern/kern_exit.c | |
parent | 0b81a496572c1f07b5403b35bdf7d54c37e4367e (diff) | |
download | FreeBSD-src-802017a04b7fb1bc31576aa2de108cf67083c42c.zip FreeBSD-src-802017a04b7fb1bc31576aa2de108cf67083c42c.tar.gz |
Add kern.racct.enable tunable and RACCT_DISABLED config option.
The point of this is to be able to add RACCT (with RACCT_DISABLED)
to GENERIC, to avoid having to rebuild the kernel to use rctl(8).
Differential Revision: https://reviews.freebsd.org/D2369
Reviewed by: kib@
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r-- | sys/kern/kern_exit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 4d23fc0..0a601a1 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -907,9 +907,11 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options) * Destroy resource accounting information associated with the process. */ #ifdef RACCT - PROC_LOCK(p); - racct_sub(p, RACCT_NPROC, 1); - PROC_UNLOCK(p); + if (racct_enable) { + PROC_LOCK(p); + racct_sub(p, RACCT_NPROC, 1); + PROC_UNLOCK(p); + } #endif racct_proc_exit(p); |