Move pool subsystem init from rump__init() to uvm_init(), following kernel code. Fix RUMP_LOCKDEBUG early panic.diff -r1.238 -r1.239 src/sys/rump/librump/rumpkern/rump.c
(njoly)
--- src/sys/rump/librump/rumpkern/rump.c 2011/12/04 19:24:59 1.238
+++ src/sys/rump/librump/rumpkern/rump.c 2012/01/29 14:57:31 1.239
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rump.c,v 1.238 2011/12/04 19:24:59 jym Exp $ */ | 1 | /* $NetBSD: rump.c,v 1.239 2012/01/29 14:57:31 njoly Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. | 4 | * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * | 14 | * | |
@@ -16,27 +16,27 @@ | @@ -16,27 +16,27 @@ | |||
16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | * SUCH DAMAGE. | 25 | * SUCH DAMAGE. | |
26 | */ | 26 | */ | |
27 | 27 | |||
28 | #include <sys/cdefs.h> | 28 | #include <sys/cdefs.h> | |
29 | __KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.238 2011/12/04 19:24:59 jym Exp $"); | 29 | __KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.239 2012/01/29 14:57:31 njoly Exp $"); | |
30 | 30 | |||
31 | #include <sys/systm.h> | 31 | #include <sys/systm.h> | |
32 | #define ELFSIZE ARCH_ELFSIZE | 32 | #define ELFSIZE ARCH_ELFSIZE | |
33 | 33 | |||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> | |
35 | #include <sys/atomic.h> | 35 | #include <sys/atomic.h> | |
36 | #include <sys/buf.h> | 36 | #include <sys/buf.h> | |
37 | #include <sys/callout.h> | 37 | #include <sys/callout.h> | |
38 | #include <sys/conf.h> | 38 | #include <sys/conf.h> | |
39 | #include <sys/cpu.h> | 39 | #include <sys/cpu.h> | |
40 | #include <sys/device.h> | 40 | #include <sys/device.h> | |
41 | #include <sys/evcnt.h> | 41 | #include <sys/evcnt.h> | |
42 | #include <sys/event.h> | 42 | #include <sys/event.h> | |
@@ -290,27 +290,26 @@ rump__init(int rump_version) | @@ -290,27 +290,26 @@ rump__init(int rump_version) | |||
290 | l->l_cpu = l->l_target_cpu = rump_cpu; | 290 | l->l_cpu = l->l_target_cpu = rump_cpu; | |
291 | l->l_fd = &filedesc0; | 291 | l->l_fd = &filedesc0; | |
292 | rumpuser_set_curlwp(l); | 292 | rumpuser_set_curlwp(l); | |
293 | 293 | |||
294 | rumpuser_mutex_init(&rump_giantlock); | 294 | rumpuser_mutex_init(&rump_giantlock); | |
295 | ksyms_init(); | 295 | ksyms_init(); | |
296 | uvm_init(); | 296 | uvm_init(); | |
297 | evcnt_init(); | 297 | evcnt_init(); | |
298 | 298 | |||
299 | once_init(); | 299 | once_init(); | |
300 | kernconfig_lock_init(); | 300 | kernconfig_lock_init(); | |
301 | prop_kern_init(); | 301 | prop_kern_init(); | |
302 | 302 | |||
303 | pool_subsystem_init(); | |||
304 | kmem_init(); | 303 | kmem_init(); | |
305 | 304 | |||
306 | uvm_ra_init(); | 305 | uvm_ra_init(); | |
307 | uao_init(); | 306 | uao_init(); | |
308 | 307 | |||
309 | mutex_obj_init(); | 308 | mutex_obj_init(); | |
310 | callout_startup(); | 309 | callout_startup(); | |
311 | 310 | |||
312 | kprintf_init(); | 311 | kprintf_init(); | |
313 | loginit(); | 312 | loginit(); | |
314 | 313 | |||
315 | kauth_init(); | 314 | kauth_init(); | |
316 | 315 |
--- src/sys/rump/librump/rumpkern/vm.c 2012/01/27 19:48:41 1.121
+++ src/sys/rump/librump/rumpkern/vm.c 2012/01/29 14:57:31 1.122
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: vm.c,v 1.121 2012/01/27 19:48:41 para Exp $ */ | 1 | /* $NetBSD: vm.c,v 1.122 2012/01/29 14:57:31 njoly Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. | 4 | * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. | |
5 | * | 5 | * | |
6 | * Development of this software was supported by | 6 | * Development of this software was supported by | |
7 | * The Finnish Cultural Foundation and the Research Foundation of | 7 | * The Finnish Cultural Foundation and the Research Foundation of | |
8 | * The Helsinki University of Technology. | 8 | * The Helsinki University of Technology. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -31,27 +31,27 @@ | @@ -31,27 +31,27 @@ | |||
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * Virtual memory emulation routines. | 33 | * Virtual memory emulation routines. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | /* | 36 | /* | |
37 | * XXX: we abuse pg->uanon for the virtual address of the storage | 37 | * XXX: we abuse pg->uanon for the virtual address of the storage | |
38 | * for each page. phys_addr would fit the job description better, | 38 | * for each page. phys_addr would fit the job description better, | |
39 | * except that it will create unnecessary lossage on some platforms | 39 | * except that it will create unnecessary lossage on some platforms | |
40 | * due to not being a pointer type. | 40 | * due to not being a pointer type. | |
41 | */ | 41 | */ | |
42 | 42 | |||
43 | #include <sys/cdefs.h> | 43 | #include <sys/cdefs.h> | |
44 | __KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.121 2012/01/27 19:48:41 para Exp $"); | 44 | __KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.122 2012/01/29 14:57:31 njoly Exp $"); | |
45 | 45 | |||
46 | #include <sys/param.h> | 46 | #include <sys/param.h> | |
47 | #include <sys/atomic.h> | 47 | #include <sys/atomic.h> | |
48 | #include <sys/buf.h> | 48 | #include <sys/buf.h> | |
49 | #include <sys/kernel.h> | 49 | #include <sys/kernel.h> | |
50 | #include <sys/kmem.h> | 50 | #include <sys/kmem.h> | |
51 | #include <sys/vmem.h> | 51 | #include <sys/vmem.h> | |
52 | #include <sys/mman.h> | 52 | #include <sys/mman.h> | |
53 | #include <sys/null.h> | 53 | #include <sys/null.h> | |
54 | #include <sys/vnode.h> | 54 | #include <sys/vnode.h> | |
55 | 55 | |||
56 | #include <machine/pmap.h> | 56 | #include <machine/pmap.h> | |
57 | 57 | |||
@@ -320,26 +320,27 @@ uvm_init(void) | @@ -320,26 +320,27 @@ uvm_init(void) | |||
320 | #undef FAKE_PAGE_SHIFT | 320 | #undef FAKE_PAGE_SHIFT | |
321 | #endif | 321 | #endif | |
322 | 322 | |||
323 | mutex_init(&pagermtx, MUTEX_DEFAULT, 0); | 323 | mutex_init(&pagermtx, MUTEX_DEFAULT, 0); | |
324 | mutex_init(&uvm_pageqlock, MUTEX_DEFAULT, 0); | 324 | mutex_init(&uvm_pageqlock, MUTEX_DEFAULT, 0); | |
325 | mutex_init(&uvm_swap_data_lock, MUTEX_DEFAULT, 0); | 325 | mutex_init(&uvm_swap_data_lock, MUTEX_DEFAULT, 0); | |
326 | 326 | |||
327 | mutex_init(&pdaemonmtx, MUTEX_DEFAULT, 0); | 327 | mutex_init(&pdaemonmtx, MUTEX_DEFAULT, 0); | |
328 | cv_init(&pdaemoncv, "pdaemon"); | 328 | cv_init(&pdaemoncv, "pdaemon"); | |
329 | cv_init(&oomwait, "oomwait"); | 329 | cv_init(&oomwait, "oomwait"); | |
330 | 330 | |||
331 | kernel_map->pmap = pmap_kernel(); | 331 | kernel_map->pmap = pmap_kernel(); | |
332 | 332 | |||
333 | pool_subsystem_init(); | |||
333 | vmem_bootstrap(); | 334 | vmem_bootstrap(); | |
334 | kmem_arena = vmem_create("kmem", 0, 1024*1024, PAGE_SIZE, | 335 | kmem_arena = vmem_create("kmem", 0, 1024*1024, PAGE_SIZE, | |
335 | NULL, NULL, NULL, | 336 | NULL, NULL, NULL, | |
336 | 0, VM_NOSLEEP | VM_BOOTSTRAP, IPL_VM); | 337 | 0, VM_NOSLEEP | VM_BOOTSTRAP, IPL_VM); | |
337 | 338 | |||
338 | vmem_init(kmem_arena); | 339 | vmem_init(kmem_arena); | |
339 | 340 | |||
340 | kmem_va_arena = vmem_create("kva", 0, 0, PAGE_SIZE, | 341 | kmem_va_arena = vmem_create("kva", 0, 0, PAGE_SIZE, | |
341 | vmem_alloc, vmem_free, kmem_arena, | 342 | vmem_alloc, vmem_free, kmem_arena, | |
342 | 32 * PAGE_SIZE, VM_NOSLEEP | VM_BOOTSTRAP, IPL_VM); | 343 | 32 * PAGE_SIZE, VM_NOSLEEP | VM_BOOTSTRAP, IPL_VM); | |
343 | 344 | |||
344 | pool_cache_bootstrap(&pagecache, sizeof(struct vm_page), 0, 0, 0, | 345 | pool_cache_bootstrap(&pagecache, sizeof(struct vm_page), 0, 0, 0, | |
345 | "page$", NULL, IPL_NONE, pgctor, pgdtor, NULL); | 346 | "page$", NULL, IPL_NONE, pgctor, pgdtor, NULL); |