svn commit: r254164 - head/sys/arm/include
Alan Cox
alc at rice.edu
Fri Aug 9 22:18:49 UTC 2013
On Aug 9, 2013, at 2:53 PM, Olivier Houchard wrote:
> Author: cognet
> Date: Fri Aug 9 21:53:02 2013
> New Revision: 254164
> URL: http://svnweb.freebsd.org/changeset/base/254164
>
> Log:
> Make sure vm_kmem_size is aligned on a page boundary, since that's what vmem
> expects.
>
> Modified:
> head/sys/arm/include/vmparam.h
>
> Modified: head/sys/arm/include/vmparam.h
> ==============================================================================
> --- head/sys/arm/include/vmparam.h Fri Aug 9 21:14:55 2013 (r254163)
> +++ head/sys/arm/include/vmparam.h Fri Aug 9 21:53:02 2013 (r254164)
> @@ -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)
> +#define VM_KMEM_SIZE_MAX (((vm_max_kernel_address - \
> + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) &~ PAGE_MASK)
> #endif
>
> #ifdef ARM_USE_SMALL_ALLOC
>
I would suggest a different approach. Add a round_page() to kmeminit() after the TUNABLE_ULONG_FETCH("vm.kmem_size", ...). This alternate approach has two virtues. First, it will also handle a /boot/loader.conf value that isn't page aligned. Second, it will simultaneously address the same problem on other architectures.
Thanks,
Alan
More information about the svn-src-head
mailing list