summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2011-03-29 17:47:25 +0000
committertrasz <trasz@FreeBSD.org>2011-03-29 17:47:25 +0000
commitb8d3e8755df2ce0e93cf3b2ab68e0c4275c5565f (patch)
tree304753d7f5287660a242996801bd5664ee945d3a /sys/kern/init_main.c
parent056d03857b74836195225ca4b0216f0d197477b7 (diff)
downloadFreeBSD-src-b8d3e8755df2ce0e93cf3b2ab68e0c4275c5565f.zip
FreeBSD-src-b8d3e8755df2ce0e93cf3b2ab68e0c4275c5565f.tar.gz
Add racct. It's an API to keep per-process, per-jail, per-loginclass
and per-loginclass resource accounting information, to be used by the new resource limits code. It's connected to the build, but the code that actually calls the new functions will come later. Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version)
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index eef0808..1977b96 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
+#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/systm.h>
#include <sys/signalvar.h>
@@ -526,6 +527,9 @@ proc0_init(void *dummy __unused)
p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_max = pageablemem;
p->p_cpulimit = RLIM_INFINITY;
+ /* Initialize resource accounting structures. */
+ racct_create(&p->p_racct);
+
p->p_stats = pstats_alloc();
/* Allocate a prototype map so we have something to fork. */
OpenPOWER on IntegriCloud