How can I get more vmalloc/ioremap space?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I get more vmalloc/ioremap space?

Jump to solution
2,710 Views
caryo_brien
Contributor III

I have a P1022 board with 256MB of NOR Flash and 2GB of DDR.

I need to map all of the flash, as well as several other devices, and I"m running

out of vmalloc/ioremap space.

Here's what the kernel says at startup:

[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xfffbf000..0xfffff000  : fixmap
[    0.000000]   * 0xff800000..0xffc00000  : highmem PTEs
[    0.000000]   * 0xff7fd000..0xff800000  : early ioremap
[    0.000000]   * 0xf1000000..0xff7fd000  : vmalloc & ioremap

So I have less than 256MB.  I can map some of flash by cutting

down the defined size in the dtb, but we may need the space.

If I try to define the whole flash the cfi probe routine can't

vmalloc() the space for the flash and nothing is accessible.

I tried using vmalloc=1024m and it did nothing

I tried adjusting CONFIG_KERNEL_PHYSICAL_START and

that didn't seem to do anything.

Any guidance on how to adjust these parameters?  I'd rather

have a plan than start changing things without understanding

the consequences.

Thanks,

Cary O'Brien

Labels (1)
0 Kudos
1 Solution
872 Views
scottwood
NXP Employee
NXP Employee

arch/powerpc does not use the vmalloc boot parameter.  Instead, vmalloc space is what's left over after you subtract the user address space and low memory.  These are controlled by CONFIG_PAGE_OFFSET and CONFIG_LOWMEM_SIZE, respectively.

CONFIG_PHYSICAL_START is not related to this -- it is used to indicate, with a non-relocatable kernel, that the kernel will be loaded at a physical address other than zero.

View solution in original post

0 Kudos
3 Replies
873 Views
scottwood
NXP Employee
NXP Employee

arch/powerpc does not use the vmalloc boot parameter.  Instead, vmalloc space is what's left over after you subtract the user address space and low memory.  These are controlled by CONFIG_PAGE_OFFSET and CONFIG_LOWMEM_SIZE, respectively.

CONFIG_PHYSICAL_START is not related to this -- it is used to indicate, with a non-relocatable kernel, that the kernel will be loaded at a physical address other than zero.

0 Kudos
872 Views
caryo_brien
Contributor III

Excellent, thank you.

I removed 256MB from CONFIG_PAGE_OFFSET and 246MB from CONFIG_LOWMEM_SIZE.

I got an error about regions overlapping and removed 512MB from USER_TASK_SIZE and

now there is plenty of room for flash.

To be more specifc, in the defconfig I have

#
# Advanced setup
#
CONFIG_ADVANCED_OPTIONS=y
CONFIG_LOWMEM_SIZE_BOOL=y
CONFIG_LOWMEM_SIZE=0x20000000
# CONFIG_LOWMEM_CAM_NUM_BOOL is not set
CONFIG_LOWMEM_CAM_NUM=3
# CONFIG_DYNAMIC_MEMSTART is not set
CONFIG_PAGE_OFFSET_BOOL=y
CONFIG_PAGE_OFFSET=0xB0000000
# CONFIG_KERNEL_START_BOOL is not set
CONFIG_KERNEL_START=0xC0000000
# CONFIG_PHYSICAL_START_BOOL is not set
CONFIG_PHYSICAL_START=0x00000000
CONFIG_PHYSICAL_ALIGN=0x04000000
CONFIG_TASK_SIZE_BOOL=y
CONFIG_TASK_SIZE=0xa0000000
CONFIG_NET=y

And the kernel startup shows.

[    0.000000]   * 0xfffbf000..0xfffff000  : fixmap
[    0.000000]   * 0xff800000..0xffc00000  : highmem PTEs
[    0.000000]   * 0xff7fd000..0xff800000  : early ioremap
[    0.000000]   * 0xd1000000..0xff7fd000  : vmalloc & ioremap

Which is 512MB more than before.  So it all makes sense.

Thanks again,

Cary O'Brien

0 Kudos
872 Views
scottwood
NXP Employee
NXP Employee

Oh sorry, I forgot about TASK_SIZE.  It should be set to the same value as PAGE_OFFSET -- the lowmem/highmem split is irrelevant to TASK_SIZE.

Unless you know that you're pushing against the limits of the user task size, it's probably better to keep lowmem at 768 MiB and get the entire vmalloc increase by reducing the user task size.

0 Kudos