From owner-svn-src-head@FreeBSD.ORG Fri Aug 9 22:30:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 08CFDBC0; Fri, 9 Aug 2013 22:30:55 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA3FB26B5; Fri, 9 Aug 2013 22:30:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r79MUspw058575; Fri, 9 Aug 2013 22:30:54 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r79MUsCY058573; Fri, 9 Aug 2013 22:30:54 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201308092230.r79MUsCY058573@svn.freebsd.org> From: Olivier Houchard Date: Fri, 9 Aug 2013 22:30:54 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2013 22:30:55 -0000 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