summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-05-28 09:30:28 +0000
committerphk <phk@FreeBSD.org>1998-05-28 09:30:28 +0000
commitd3d65c6b2e376ac074f3ca386b6f5b70ea37636f (patch)
tree6beef0d8c93f6063bf0b9870b87a8c1ef8267cd4 /sys/kern/init_main.c
parent3654f28d394a609d42e7000c62963c45e3bba3db (diff)
downloadFreeBSD-src-d3d65c6b2e376ac074f3ca386b6f5b70ea37636f.zip
FreeBSD-src-d3d65c6b2e376ac074f3ca386b6f5b70ea37636f.tar.gz
Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.
Clean up (or if antipodic: down) some of the msgbuf stuff. Use an inline function rather than a macro for timecounter delta. Maintain process "on-cpu" time as 64 bits of microseconds to avoid needless second rollover overhead. Avoid calling microuptime the second time in mi_switch() if we do not pass through _idle in cpu_switch() This should reduce our context-switch overhead a bit, in particular on pre-P5 and SMP systems. WARNING: Programs which muck about with struct proc in userland will have to be fixed. Reviewed, but found imperfect by: bde
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index ba263aa..ea599a7 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
- * $Id: init_main.c,v 1.91 1998/04/19 23:31:54 julian Exp $
+ * $Id: init_main.c,v 1.92 1998/05/17 11:52:35 phk Exp $
*/
#include "opt_devfs.h"
@@ -377,8 +377,10 @@ proc0_init(dummy)
limit0.pl_rlimit[RLIMIT_RSS].rlim_max = i;
limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_max = i;
limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = i / 3;
+ limit0.p_cpulimit = RLIM_INFINITY;
limit0.p_refcnt = 1;
+
/* Allocate a prototype map so we have something to fork. */
pmap_pinit0(&vmspace0.vm_pmap);
p->p_vmspace = &vmspace0;
@@ -426,13 +428,13 @@ proc0_post(dummy)
/*
* Now can look at time, having had a chance to verify the time
- * from the file system. Reset p->p_rtime as it may have been
+ * from the file system. Reset p->p_runtime as it may have been
* munched in mi_switch() after the time got set. Set
- * p->p_runtime to be consistent with this unmunching.
+ * p->p_switchtime to be consistent with this unmunching.
*/
microtime(&proc0.p_stats->p_start);
- timevalclear(&proc0.p_rtime);
- microuptime(&proc0.p_runtime);
+ proc0.p_runtime = 0;
+ microuptime(&proc0.p_switchtime);
/*
* Give the ``random'' number generator a thump.
OpenPOWER on IntegriCloud