vmalloc_reserve with no highmem

Russell King - ARM Linux linux at arm.linux.org.uk
Tue Oct 20 12:25:54 PDT 2015


On Tue, Oct 20, 2015 at 12:17:59PM -0700, Florian Fainelli wrote:
> On 20/10/15 11:52, Laura Abbott wrote:
> > On 10/19/2015 04:20 PM, Florian Fainelli wrote:
> >> Hi Russell, Laura,
> >>
> >> Setting vmalloc= on the kernel command-line to define the amount of
> >> vmalloc_reserve is not quite working when you have no highmem, as is the
> >> case of one my boards which has 512MB or 256M populated on a first bank
> >> at PA 0x0.
> >>
> >> What happens in that case is that, despite setting vmalloc_reserve,
> >> therefore bumping up vmalloc_min to a higher address than high_memory,
> >> which is assigned __va(arm_lowmem_limit), we end-up with VMALLOC_START
> >> at high_memory + VMALLOC_OFFSET, which yields the amount of physical
> >> memory (start at PA 0x0 in my case) - VMALLOC_OFFSET.
> >>
> >> The maths look like this for this particular board (512MB)
> >>
> >> high_memory = 0x20000000 + PAGE_OFFSET = 0x20000000 + 0xC0000000 =
> >> 0xE0000000
> >> vmalloc_min = 0xFF00000 - (248 * 1024 * 1024) = 0xEF800000
> >>
> >> so we end-up with VMALLOC_START = high_memory + VMALLOC_OFFSET =
> >> 0xE0000000 + 8 * 1024* 1024 = 0xE0800000

Correct, high_memory will be 0xe0000000, which will set VMALLOC_START
to 0xe0800000, and you'll have lots of vmalloc space available.  That's
intentional.

vmalloc= sets the _minimum_ vmalloc space that's available, not the
absolute amount of space.

> > #define VMALLOC_OFFSET          (8*1024*1024)
> > #define VMALLOC_START           (((unsigned long)high_memory +
> > VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
> > #define VMALLOC_END             0xff000000UL
> > 
> > VMALLOC_START is based off of the value of high_memory. high_memory
> > is supposed to be the limit of the kernel direct mapped ram region so
> > setting it to something above that is asking for trouble.
> 
> You're right, that does not seem right.

That's correct.  high_memory is the last address of mapped lowmem.
We then have an 8MB space.  The quote above is correct.

I don't see what the problem is.

-- 
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.



More information about the linux-arm-kernel mailing list