summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2013-08-09 22:30:54 +0000
committercognet <cognet@FreeBSD.org>2013-08-09 22:30:54 +0000
commit51c3f72bfa5a76f897b44233d886641ea448eb77 (patch)
tree6519fdae436fbb8aac26852feed54a8c99be6dcf
parent4933953bc5498599ab8c1724217a5caebd26ff1e (diff)
downloadFreeBSD-src-51c3f72bfa5a76f897b44233d886641ea448eb77.zip
FreeBSD-src-51c3f72bfa5a76f897b44233d886641ea448eb77.tar.gz
Instead of just trying to do it for arm, make sure vm_kmem_size is properly
aligned in kmeminit(), where it'll work for any arch. Suggested by: alc
-rw-r--r--sys/arm/include/vmparam.h4
-rw-r--r--sys/kern/kern_malloc.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/sys/arm/include/vmparam.h b/sys/arm/include/vmparam.h
index 4c0efd3..598cf42 100644
--- a/sys/arm/include/vmparam.h
+++ b/sys/arm/include/vmparam.h
@@ -165,8 +165,8 @@
* Ceiling on the size of the kmem submap: 40% of the kernel map.
*/
#ifndef VM_KMEM_SIZE_MAX
-#define VM_KMEM_SIZE_MAX (((vm_max_kernel_address - \
- VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) &~ PAGE_MASK)
+#define VM_KMEM_SIZE_MAX ((vm_max_kernel_address - \
+ VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
#endif
#ifdef ARM_USE_SMALL_ALLOC
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 63d8386..dae4b13 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -740,6 +740,7 @@ kmeminit(void)
if (vm_kmem_size / 2 / PAGE_SIZE > mem_size)
vm_kmem_size = 2 * mem_size * PAGE_SIZE;
+ vm_kmem_size = round_page(vm_kmem_size);
#ifdef DEBUG_MEMGUARD
tmp = memguard_fudge(vm_kmem_size, kernel_map);
#else
OpenPOWER on IntegriCloud