Linux Kernel Architecture

(Jacob Rumans) #1

Chapter3:MemoryManagement


Table 3-6: Different Splitting Ratios for the IA-32 Virtual Address Space, and the
Resulting Maximum Identity-Mapped Physical Memory.

Ratio CONFIG_PAGE_OFFSET MAXMEM(MiB)

3:1 0xC0000000 896

≈3:1 0xB0000000 1152

2:2 0x80000000 1920

≈2:2 0x78000000 2048

1:3 0x40000000 2944

PAE enabled?

Use PSE, PGE extensions if possible

Initialize fixmaps

paging_init

set_nx

pagetable_init

kernel_physical_mapping_init

permanent_kmaps_init

load_cr3

__flush_all_tlb

kmap_init

Figure 3-16: Code flow diagram forpaging_init.

pagetable_initfirst initializes the page tables of the system usingswapper_pg_diras a basic (this
variable was previously used to hold the provisional data). Two extensions available on all modern
IA-32 variants are then enabled (only a few very old Pentium implementations do not support these).

❑ Support for large memory pages. The size of specially marked pages is 4 MiB instead of the usual
4 KiB. This option is used for kernel pages because they are never swapped out. Increasing the
page size means that fewer page table entries are needed, and this has a positive impact on the
translation lookaside buffers (TLBs), which are then less burdened with kernel data.
❑ If possible, kernel pages are provided with a further attribute (_PAGE_GLOBAL) that is why the
__PAGE_GLOBALbit is activated in the__PAGE_KERNELand__PAGE_KERNEL_EXECvariables. These
Free download pdf