diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2003-06-01 16:23:42 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2003-06-01 16:23:42 +0000 |
commit | f139043b58d8ac1657257c0b18009906a5c1c392 (patch) | |
tree | f9fbd34d228f52c6ae36a2959263ba679a3c165e /sys/kern | |
parent | df3e6a52b1014ae1a0bfae59ab7b5808c84b9f48 (diff) |
uvm_km_suballoc passes the 'min' argument untouched to uvm_map. uvm_map
uses it as a hint for where to steal space from the parent map. We've been
passing random stack garbage as that hint for ages. It's a wonder it didn't
break things until we started working on Hammer.
noone objected for at least a week.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_malloc.c | 13 | ||||
-rw-r--r-- | sys/kern/uipc_mbuf.c | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 91a7ad9e0a3..ba9810b478b 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_malloc.c,v 1.51 2003/05/03 21:14:59 deraadt Exp $ */ +/* $OpenBSD: kern_malloc.c,v 1.52 2003/06/01 16:23:41 art Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */ /* @@ -474,6 +474,7 @@ kmeminit_nkmempages() void kmeminit() { + vaddr_t base, limit; #ifdef KMEMSTATS long indx; #endif @@ -488,10 +489,12 @@ kmeminit() * done so already. */ kmeminit_nkmempages(); - - kmem_map = uvm_km_suballoc(kernel_map, (vaddr_t *)&kmembase, - (vaddr_t *)&kmemlimit, (vsize_t)(nkmempages * PAGE_SIZE), - VM_MAP_INTRSAFE, FALSE, &kmem_map_store.vmi_map); + base = vm_map_min(kernel_map); + kmem_map = uvm_km_suballoc(kernel_map, &base, &limit, + (vsize_t)(nkmempages * PAGE_SIZE), VM_MAP_INTRSAFE, FALSE, + &kmem_map_store.vmi_map); + kmembase = (char *)base; + kmemlimit = (char *)limit; kmemusage = (struct kmemusage *) uvm_km_zalloc(kernel_map, (vsize_t)(nkmempages * sizeof(struct kmemusage))); #ifdef KMEMSTATS diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 757e57380a9..b0c6d389458 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.60 2003/04/23 01:36:52 jason Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.61 2003/06/01 16:23:41 art Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -122,6 +122,7 @@ mbinit() { vaddr_t minaddr, maxaddr; + minaddr = vm_map_min(kernel_map); mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, nmbclust*(MCLBYTES), VM_MAP_INTRSAFE, FALSE, NULL); |