Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/init_main.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/init_main.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.355 retrieving revision 1.355.2.4 diff -u -p -r1.355 -r1.355.2.4 --- src/sys/kern/init_main.c 2008/05/01 14:44:48 1.355 +++ src/sys/kern/init_main.c 2008/09/18 04:31:41 1.355.2.4 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.355 2008/05/01 14:44:48 ad Exp $ */ +/* $NetBSD: init_main.c,v 1.355.2.4 2008/09/18 04:31:41 wrstuden Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.355 2008/05/01 14:44:48 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.355.2.4 2008/09/18 04:31:41 wrstuden Exp $"); #include "opt_ipsec.h" #include "opt_ntp.h" @@ -108,6 +108,7 @@ __KERNEL_RCSID(0, "$NetBSD: init_main.c, #include "opt_fileassoc.h" #include "opt_ktrace.h" #include "opt_pax.h" +#include "opt_wapbl.h" #include "rnd.h" #include "sysmon_envsys.h" @@ -160,6 +161,7 @@ __KERNEL_RCSID(0, "$NetBSD: init_main.c, #include #include #include +#include #ifdef FAST_IPSEC #include #endif @@ -191,6 +193,9 @@ __KERNEL_RCSID(0, "$NetBSD: init_main.c, #include #endif #include +#ifdef WAPBL +#include +#endif #include #include @@ -239,7 +244,7 @@ int boothowto; int cold = 1; /* still working on startup */ struct timeval boottime; /* time at system startup - will only follow settime deltas */ -volatile int start_init_exec; /* semaphore for start_init() */ +int start_init_exec; /* semaphore for start_init() */ static void check_console(struct lwp *l); static void start_init(void *); @@ -371,7 +376,7 @@ main(void) */ evcnt_init(); /* initialize event counters */ #if NRND > 0 - rnd_init(); /* initialize RNG */ + rnd_init(); /* initialize random number generator */ #endif /* Initialize process and pgrp structures. */ @@ -435,14 +440,16 @@ main(void) /* * If maximum number of vnodes in namei vnode cache is not explicitly * defined in kernel config, adjust the number such as we use roughly - * 1.0% of memory for vnode cache (but not less than NVNODE vnodes). + * 10% of memory for vnodes and associated data structures in the + * assumed worst case. Do not provide fewer than NVNODE vnodes. */ usevnodes = - calc_cache_size(kernel_map, 1, VNODE_VA_MAXPCT) / sizeof(vnode_t); + calc_cache_size(kernel_map, 10, VNODE_VA_MAXPCT) / VNODE_COST; if (usevnodes > desiredvnodes) desiredvnodes = usevnodes; #endif vfsinit(); + lf_init(); /* Initialize fstrans. */ fstrans_init(); @@ -492,6 +499,9 @@ main(void) /* Initialize the disk wedge subsystem. */ dkwedge_init(); + /* Initialize interfaces. */ + ifinit1(); + /* Configure the system hardware. This will enable interrupts. */ configure(); @@ -564,6 +574,11 @@ main(void) /* Initialize the UUID system calls. */ uuid_init(); +#ifdef WAPBL + /* Initialize write-ahead physical block logging. */ + wapbl_init(); +#endif + /* * Create process 1 (init(8)). We do this now, as Unix has * historically had init be process 1, and changing this would @@ -581,7 +596,6 @@ main(void) * storage to the VM system. */ module_init_class(MODULE_CLASS_ANY); - module_jettison(); /* * Finalize configuration now that all real devices have been @@ -690,8 +704,10 @@ main(void) /* * Okay, now we can let init(8) exec! It's off to userland! */ + mutex_enter(proc_lock); start_init_exec = 1; - wakeup(&start_init_exec); + cv_broadcast(&lbolt); + mutex_exit(proc_lock); /* The scheduler is an infinite loop. */ uvm_scheduler(); @@ -755,8 +771,10 @@ start_init(void *arg) /* * Wait for main() to tell us that it's safe to exec. */ + mutex_enter(proc_lock); while (start_init_exec == 0) - (void) tsleep(&start_init_exec, PWAIT, "initexec", 0); + cv_wait(&lbolt, proc_lock); + mutex_exit(proc_lock); /* * This is not the right way to do this. We really should