[PATCH] Add a VMSPLIT_2G_OPT config option.

Arnd Bergmann arnd at kernel.org
Wed Nov 4 03:20:15 EST 2020


On Tue, Nov 3, 2020 at 11:56 PM Ard Biesheuvel <ardb at kernel.org> wrote:
>
> (+ Russell, Arnd, Linus)
>
> On Tue, 3 Nov 2020 at 22:52, Christian Melki <christian.melki at t2data.com> wrote:
> >
> > This allows 2GB systems to have their RAM entirely mapped as low memory.
> > Needed to avoid CONFIG_HIGHMEM for the last 256M.
> >
> > Definitely not an uncommon configuration in the industry.
> > Following the discussions about deprecating CONFIG_HIGHMEM down the
> > line, this is probably a nice addition.
> >
> > Tested on a Kontron i.MX6 Quad board equipped with 2G RAM.
> >
> > Signed-off-by: Christian Melki <christian.melki at t2data.com>
>
> Acked-by: Ard Biesheuvel <ardb at kernel.org>

I had wanted to send a patch like this for a long time, but I never
got around to doing it, partly as I don't have good hardware to test
it on. Thanks a lot for taking care of it!

It would be nice if distros could enable this by default in the
non-LPAE kernels, given the increasing interest in eventually
removing highmem support. Unfortunately it requires a lot of
testing to figure out exactly how bad the impact of the reduced
user address range is in practice. It seems that mips32 has
always had a 2GB user virtual space (and only 512MB of
lowmem), while arm, x86, and powerpc are configurable but
usually go with 3GB of user virtual space.

I suppose this bit should be added to slightly reduce the
chance of exhausting the address space:

--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -300,6 +300,7 @@ config ARCH_MMAP_RND_BITS_MIN
 config ARCH_MMAP_RND_BITS_MAX
        default 14 if PAGE_OFFSET=0x40000000
        default 15 if PAGE_OFFSET=0x80000000
+       default 15 if PAGE_OFFSET=0xB0000000
        default 16

 #

With that added:

Acked-by: Arnd Bergmann <arnd at arndb.de>



More information about the linux-arm-kernel mailing list