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

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to