Physical Kernel Address

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2023 Nov 22 7:44
Editor
Edited
Edited
2023 Nov 22 7:45
Refs
Refs

Implications

  • Memory allocations in the kernel area always land in physical RAM
  • Simple mapping:
  • 1단계 page table 1024개에서 1/4는 커널 거다
 

Fixed
Kernel Space
address mapping

notion image
In practice, kernel physically pin kernel address space in hardware, preventing paging out. by using hardware global bit (G): prevent TLB flushing (apply only to PTE). That is the basic reason why the ratio is 1:3.
The physical memory is directly mapped into the kernel address space, which is maximum 1G (with PAGE_OFFSET=3G)
notion image
Pages inside dynamic memory area can be owned by user or kernel
notion image
high_memory, low_memory standard divide pinned address
The kernel uses the two frequently employed abbreviations “lowmem” and “highmem” (beyond 896M) to distinguish between physical frames that can be mapped directly to kernel address space, and those that cannot.
  • lowmem: physical memory for which logical addresses exist in kernel space
  • highmem: physical memory for which logical addresses do not exist.
 
1024 - 128 = 896 for magic space
  • The vmalloc area - biggest
    • noncontiguous frame mapping
    • allocate continuous kernel virtual address with non-contiguous physical addresses
  • High memory mappings (persistent mappings)
    • used to map pages from the highmem area into the kerne
  • Fixmaps (temporary mappings)
    • notion image
notion image
Rightmost blue arrow should be point 896M (error)
Rightmost blue arrow should be point 896M (error)
 
 
 
 
 
 
 
 
 

Recommendations