Alternative Division

Dividing virtual address space in a 3 : 1 ratio is not the only option. Relatively little effort is needed to select a different division because all bounds are defined by constants in the sources. For some purposes it may be better to split the address space symmetrically, 2 GiB for user address space and 2 GiB for kernel address space._page_offset must then be set to 0x80000000 instead of the typical default of

0xC0000000. This division is useful when the system performs tasks that require a large amount of memory for the kernel but little for the user processes (such tasks are rare). As any change to how memory is divided requires recompilation of all userspace applications, the configuration statements include no option to split memory differently, although this would be easy to do in principle.

Basically, it is possible to split memory by manually modifying the kernel sources, but the kernel offers some default splitting ratios._page_offset is then defined as follows:

include/asm-x86/page_32.h

#define_PAGE_OFFSET # ((unsigned long)CONFIG_PAGE_OFFSET)

Table 3-6 collects all possibilities for splitting the virtual address space and the resulting maximal amount of RAM that can be mapped.

Splitting the kernel in ratios other than 3 : 1 can make sense in specific scenarios, for instance, for machines that mainly run code in the kernel — think about network routers. The general case, however, is best served with a 3 : 1 ratio.

Continue reading here: Splitting the Virtual Address Space

Was this article helpful?

0 0