linuxsplitlinux-kerneladdress-space

Kernel space and user space virtual address division


Whether the kernel space and user space address ranges are always divided in 1:3 ratio.

For example if I have 4GB of address space and 4GB of physical RAM then the kernel gets 1GB and user space gets 3GB (assumed)!

So if I have 2GB of RAM then is it like the following?

kernel: 512MB
user space: 0-1536MB

Is this correct assumption?


Solution

  • No, the split is only for dividing up the virtual address space.

    It just means that the address space from 0x00000000 up to 0xBFFFFFFF 'belongs' to or is available for mapping in user-space. Virtual addresses 0xC0000000 to 0xFFFFFFFF belong to the kernel.

    The amount of available RAM and how it is used has nothing to do with how the virtual address space is partitioned in the Linux kernel.

    FWIW, on ARM, you can configure what the split is so it doesn't HAVE to be 3:1 (user:kernel). It can be 1:3, 2:2 or 3:1. I'm assuming there is a similar option for the x86 arch.