diff options
author | trasz <trasz@FreeBSD.org> | 2015-06-21 06:28:26 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2015-06-21 06:28:26 +0000 |
commit | e1055c772b450db60c53109ac296de1c9322438d (patch) | |
tree | c4fe9dc7d6f9ae04616fa06a004cd2d251b922b7 /sys/kern/kern_exit.c | |
parent | 964ee5e924b5e0ab8fa3866fa26b2c4f8642d656 (diff) | |
download | FreeBSD-src-e1055c772b450db60c53109ac296de1c9322438d.zip FreeBSD-src-e1055c772b450db60c53109ac296de1c9322438d.tar.gz |
MFC r282213:
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).
MFC r282901:
Build GENERIC with RACCT/RCTL support by default. Note that it still
needs to be enabled by adding "kern.racct.enable=1" to /boot/loader.conf.
Note those two are MFC-ed together, because the latter one changes the
name of RACCT_DISABLED option to RACCT_DEFAULT_TO_DISABLED. Should have
committed the renaming separately...
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 9c72442..d4ed909 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -921,9 +921,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); |