Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2013 15:18:40 -0700
From:      Alan Cox <alc@rice.edu>
To:        Olivier Houchard <cognet@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r254164 - head/sys/arm/include
Message-ID:  <4390BE71-FE5E-43DE-9687-8CA395092450@rice.edu>
In-Reply-To: <201308092153.r79Lr2BY043441@svn.freebsd.org>
References:  <201308092153.r79Lr2BY043441@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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
>=20
> Log:
>  Make sure vm_kmem_size is aligned on a page boundary, since that's =
what vmem
>  expects.
>=20
> Modified:
>  head/sys/arm/include/vmparam.h
>=20
> Modified: head/sys/arm/include/vmparam.h
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- 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
>=20
> #ifdef ARM_USE_SMALL_ALLOC
>=20


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4390BE71-FE5E-43DE-9687-8CA395092450>