Professional Documents
Culture Documents
Agenda
Initialization Page Fault Handling Page Cache and Swap Cache Swap Area Management Copying Virtual Address Spaces
Initialization
paging_init()
set up the page tables to map in all the available physical memory Kernel has the virtual address from 3G~4G physical address = virtual address - 3G (see figure)
free_area_init()
allocate and initialize the page structures
Linux use a page structure for one physical page all page structures are marked as DMAable and RESERVED
allocate and initialize the swap cache and free area list
E.g. 16M
3G
4G Virtual address
Physical address
Initialization
mem_init()
fixup the page structures and make all the available pages free.
do_no_page()
used to page-in a page determine the source of the page
Executable file? Swap area ? Or Anonymous page?
filemap_nopage()
look for the page from page cache first read-in the page if cache miss read-ahead if necessary
swap_in()
the default swap in operation: allocate a free page and get the content of the page from the swap area de-allocate the swap page in swap area!!!!!!!
dup_mmap( )
duplicate the mmap