| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: init_main.c,v 1.518 2020/01/08 17:38:42 ad Exp $ */ | | 1 | /* $NetBSD: init_main.c,v 1.519 2020/01/28 16:35:39 ad Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -87,27 +87,27 @@ | | | @@ -87,27 +87,27 @@ |
87 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 87 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
88 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 88 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
89 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 89 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
90 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 90 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
91 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 91 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
92 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 92 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
93 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 93 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
94 | * SUCH DAMAGE. | | 94 | * SUCH DAMAGE. |
95 | * | | 95 | * |
96 | * @(#)init_main.c 8.16 (Berkeley) 5/14/95 | | 96 | * @(#)init_main.c 8.16 (Berkeley) 5/14/95 |
97 | */ | | 97 | */ |
98 | | | 98 | |
99 | #include <sys/cdefs.h> | | 99 | #include <sys/cdefs.h> |
100 | __KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.518 2020/01/08 17:38:42 ad Exp $"); | | 100 | __KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.519 2020/01/28 16:35:39 ad Exp $"); |
101 | | | 101 | |
102 | #include "opt_ddb.h" | | 102 | #include "opt_ddb.h" |
103 | #include "opt_inet.h" | | 103 | #include "opt_inet.h" |
104 | #include "opt_ipsec.h" | | 104 | #include "opt_ipsec.h" |
105 | #include "opt_modular.h" | | 105 | #include "opt_modular.h" |
106 | #include "opt_ntp.h" | | 106 | #include "opt_ntp.h" |
107 | #include "opt_pipe.h" | | 107 | #include "opt_pipe.h" |
108 | #include "opt_syscall_debug.h" | | 108 | #include "opt_syscall_debug.h" |
109 | #include "opt_sysv.h" | | 109 | #include "opt_sysv.h" |
110 | #include "opt_fileassoc.h" | | 110 | #include "opt_fileassoc.h" |
111 | #include "opt_ktrace.h" | | 111 | #include "opt_ktrace.h" |
112 | #include "opt_pax.h" | | 112 | #include "opt_pax.h" |
113 | #include "opt_compat_netbsd.h" | | 113 | #include "opt_compat_netbsd.h" |
| @@ -319,26 +319,29 @@ main(void) | | | @@ -319,26 +319,29 @@ main(void) |
319 | prop_kern_init(); | | 319 | prop_kern_init(); |
320 | | | 320 | |
321 | #if ((NKSYMS > 0) || (NDDB > 0) || (NMODULAR > 0)) | | 321 | #if ((NKSYMS > 0) || (NDDB > 0) || (NMODULAR > 0)) |
322 | ksyms_init(); | | 322 | ksyms_init(); |
323 | #endif | | 323 | #endif |
324 | kprintf_init(); | | 324 | kprintf_init(); |
325 | | | 325 | |
326 | percpu_init(); | | 326 | percpu_init(); |
327 | | | 327 | |
328 | /* Initialize lock caches. */ | | 328 | /* Initialize lock caches. */ |
329 | mutex_obj_init(); | | 329 | mutex_obj_init(); |
330 | rw_obj_init(); | | 330 | rw_obj_init(); |
331 | | | 331 | |
| | | 332 | /* Initialize radix trees (used by numerous subsystems). */ |
| | | 333 | radix_tree_init(); |
| | | 334 | |
332 | /* Passive serialization. */ | | 335 | /* Passive serialization. */ |
333 | pserialize_init(); | | 336 | pserialize_init(); |
334 | | | 337 | |
335 | /* Initialize the extent manager. */ | | 338 | /* Initialize the extent manager. */ |
336 | extent_init(); | | 339 | extent_init(); |
337 | | | 340 | |
338 | /* Do machine-dependent initialization. */ | | 341 | /* Do machine-dependent initialization. */ |
339 | cpu_startup(); | | 342 | cpu_startup(); |
340 | | | 343 | |
341 | /* Initialize the sysctl subsystem. */ | | 344 | /* Initialize the sysctl subsystem. */ |
342 | sysctl_init(); | | 345 | sysctl_init(); |
343 | | | 346 | |
344 | /* Initialize callouts, part 1. */ | | 347 | /* Initialize callouts, part 1. */ |
| @@ -470,27 +473,26 @@ main(void) | | | @@ -470,27 +473,26 @@ main(void) |
470 | * defined in kernel config, adjust the number such as we use roughly | | 473 | * defined in kernel config, adjust the number such as we use roughly |
471 | * 10% of memory for vnodes and associated data structures in the | | 474 | * 10% of memory for vnodes and associated data structures in the |
472 | * assumed worst case. Do not provide fewer than NVNODE vnodes. | | 475 | * assumed worst case. Do not provide fewer than NVNODE vnodes. |
473 | */ | | 476 | */ |
474 | usevnodes = calc_cache_size(vmem_size(kmem_arena, VMEM_FREE|VMEM_ALLOC), | | 477 | usevnodes = calc_cache_size(vmem_size(kmem_arena, VMEM_FREE|VMEM_ALLOC), |
475 | 10, VNODE_KMEM_MAXPCT) / VNODE_COST; | | 478 | 10, VNODE_KMEM_MAXPCT) / VNODE_COST; |
476 | if (usevnodes > desiredvnodes) | | 479 | if (usevnodes > desiredvnodes) |
477 | desiredvnodes = usevnodes; | | 480 | desiredvnodes = usevnodes; |
478 | #endif | | 481 | #endif |
479 | | | 482 | |
480 | /* Initialize fstrans. */ | | 483 | /* Initialize fstrans. */ |
481 | fstrans_init(); | | 484 | fstrans_init(); |
482 | | | 485 | |
483 | radix_tree_init(); /* used for page cache */ | | | |
484 | vfsinit(); | | 486 | vfsinit(); |
485 | lf_init(); | | 487 | lf_init(); |
486 | | | 488 | |
487 | /* Initialize the file descriptor system. */ | | 489 | /* Initialize the file descriptor system. */ |
488 | fd_sys_init(); | | 490 | fd_sys_init(); |
489 | | | 491 | |
490 | /* Initialize cwd structures */ | | 492 | /* Initialize cwd structures */ |
491 | cwd_sys_init(); | | 493 | cwd_sys_init(); |
492 | | | 494 | |
493 | /* Initialize kqueue. */ | | 495 | /* Initialize kqueue. */ |
494 | kqueue_init(); | | 496 | kqueue_init(); |
495 | | | 497 | |
496 | inittimecounter(); | | 498 | inittimecounter(); |