diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2015-04-29 10:23:02 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2015-04-29 10:23:02 +0000 |
commit | 4b5c9cf62f33d8359a272dda846930aaa7c635f8 (patch) | |
tree | 59650c7275c65023f54e8bff435945b07bc2714a /sys/kern/subr_trap.c | |
parent | da2f98a1cf890caeb84b303d3bd94da2b518785c (diff) | |
download | src-4b5c9cf62f33d8359a272dda846930aaa7c635f8.tar.gz src-4b5c9cf62f33d8359a272dda846930aaa7c635f8.zip |
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
Notes
Notes:
svn path=/head/; revision=282213
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r-- | sys/kern/subr_trap.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index cfc3ed70f6df..744c064f3a1c 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include <sys/ktr.h> #include <sys/pioctl.h> #include <sys/ptrace.h> +#include <sys/racct.h> #include <sys/resourcevar.h> #include <sys/sched.h> #include <sys/signalvar.h> @@ -172,11 +173,13 @@ userret(struct thread *td, struct trapframe *frame) __func__, td, p->p_pid, td->td_name, curvnet, (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A")); #endif -#ifdef RACCT - PROC_LOCK(p); - while (p->p_throttled == 1) - msleep(p->p_racct, &p->p_mtx, 0, "racct", 0); - PROC_UNLOCK(p); +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(p); + while (p->p_throttled == 1) + msleep(p->p_racct, &p->p_mtx, 0, "racct", 0); + PROC_UNLOCK(p); + } #endif } |