vm内存分割比例

root@james-desktop:/opt/qt-everywhere/marvell/SDK/linux-2.6.31.8# diff .config-2g config-3g
4c4
< # Sun Jun 19 10:06:59 2011
---
> # Sun Jun 19 10:06:32 2011
363,364c363,364
< # CONFIG_VMSPLIT_3G is not set
< CONFIG_VMSPLIT_2G=y
---
> CONFIG_VMSPLIT_3G=y
> # CONFIG_VMSPLIT_2G is not set
366c366
< CONFIG_PAGE_OFFSET=0x80000000
---
> CONFIG_PAGE_OFFSET=0xC0000000

修改vmalloc.h

#ifndef VMSPLIT_3G_OPT

#define VMALLOC_END       (PAGE_OFFSET + 0x28000000)

#else
//lzm for 1G mem
//org (PAGE_OFFSET + 0x28000000) 0x28000000是512M+128 E8000000

//PAGE_OFFSET - 0x20000000 = 0xA0000000
//1G Dram + 128 Vmalloc
#ifdef VMSPLIT_3G_OPT

#warning "VMSPLIT_3G_OPT only for 1G RAM, hacked by lingzheming"
#define VMALLOC_END       (PAGE_OFFSET + 0x20000000 + 0x28000000)

#endif

arch/arm/Kconfig

choice
    prompt "Memory split"
    default VMSPLIT_3G
    help
      Select the desired split between kernel and user memory.

      If you are not absolutely sure what you are doing, leave this
      option alone!

    config VMSPLIT_3G
        bool "3G/1G user/kernel split"
    config VMSPLIT_3G_OPT
        bool "hacked by lingzheming: 3G/1G user/kernel split(for full 1G low memory)"

    config VMSPLIT_2G
        bool "2G/2G user/kernel split"
    config VMSPLIT_1G
        bool "1G/3G user/kernel split"
endchoice

config PAGE_OFFSET
    hex
    default 0x40000000 if VMSPLIT_1G
    default 0x80000000 if VMSPLIT_2G
    default 0xA0000000 if VMSPLIT_3G_OPT
    default 0xC0000000

原文地址:https://www.cnblogs.com/cute/p/2084550.html