Presentation of Chapter 4, LINUX Kernel Internals
Presentation of Chapter 4, LINUX Kernel Internals
• Pages of Memory
• Virtual Address Space
• Converting the Linear Address
• The Page Directory
• The Page Middle Directory
• The Page Table
Pages of memory
• Mapping Functions
• The Kernel Segment
• Static Memory Allocation in the Kernel Segment
• Dynamic Memory Allocation in the Kernel
Segment
The user segment
• The brk field points to the end of the BSS segment for non-
statically initialized data
• Used for allocating or releasing dynamic memory
• The system call brk can be used to find the current value of
the pointer or to set it to a new one under protection check
• Rejected if the mem required exceeds the estimated size
• function sys_brk() calls do_map() to map a private and
anonymous area between the old & new values of brk
Mapping functions
• Block Buffering
• The update and bdflush Processes
• List Structures for the Buffer Cache
• Using the Buffer Cache
Block Buffering
Priority Description
GFP_BUFFER Free page to be returned only if free pages are still available
in physical mem
GFP_ATOMIC The function __get_free_page must not interrupt the current
process, but a page should be returned if possible
GFP_USER The current process may be interrupted to swap pages
GFP_KERNEL This para is the same as GFP_USER
GFP_NOBUFFER The buffer cache won’t be reduced by an attempt to find a
free page in mem
GFP_NFS The difference between this & GFP_USER is that the # of
pages reserved for GFP_ATOMIC is reduced from
min_free_pages to five. Will speed up NFS operations
Priorities for the function __get_free_page()
Page errors and reloading a page