Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2013 22:30:54 +0000 (UTC)
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254166 - in head/sys: arm/include kern
Message-ID:  <201308092230.r79MUsCY058573@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cognet
Date: Fri Aug  9 22:30:54 2013
New Revision: 254166
URL: http://svnweb.freebsd.org/changeset/base/254166

Log:
  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

Modified:
  head/sys/arm/include/vmparam.h
  head/sys/kern/kern_malloc.c

Modified: head/sys/arm/include/vmparam.h
==============================================================================
--- head/sys/arm/include/vmparam.h	Fri Aug  9 21:56:28 2013	(r254165)
+++ head/sys/arm/include/vmparam.h	Fri Aug  9 22:30:54 2013	(r254166)
@@ -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

Modified: head/sys/kern/kern_malloc.c
==============================================================================
--- head/sys/kern/kern_malloc.c	Fri Aug  9 21:56:28 2013	(r254165)
+++ head/sys/kern/kern_malloc.c	Fri Aug  9 22:30:54 2013	(r254166)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308092230.r79MUsCY058573>