1
votes

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

example if i have 4gb address space and 4gb physical ram

than kernel gets 1gb and user space gets 3gb (assumed)!

so if i have 2gb ram than is it like the following ?

kernel:512mb user address range:0-1536mb user space ?

is this correct assumption ?

1
No, probably this will help makelinux.net/ldd3/chp-15-sect-1 - Alex Hoppus
Default split is 3G/1G user/kernel (high mem/low mem) split. You can change this via CONFIG_VMSPLIT_* options, but only for x86_32. For x86_64 we don't need high mem (see this). Memory map for x86_64 described in Documentation/x86/x86_64/mm.txt. - Sam Protsenko

1 Answers

4
votes

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.