Home > Article > Operation and Maintenance > What is the principle of Linux kernel page table and page table cache?
[Page]: Blocks in the process.
[Page frame]: block in memory.
[Page table]: A special data structure that stores the page table area of the system space (storing the correspondence between logical pages and physical page frames). Each process has its own page table, and there are pointers in the PCB table pointing to the page table.
(1) Logical address (page number, offset), the logical address is the virtual address. For example, the page table entries of the secondary page table are as follows:
(2) Physical address (page frame number, offset). The mapping relationship is as follows:
[Page table cache]: CPU memory management unit (MMU), processor manufacturer in memory A cache (called the page table cache) added to the snap-in. Function to convert virtual addresses into physical addresses.
The page table is composed of multiple page table entries, and each row in the page table is a page table entry.
Page frame number: specially used to store the physical page corresponding to the virtual page.
Page table entries are designed by hardware.
Page directory provides a directory (two-dimensional structure) for the page table and supports multi-level search. When an application is running on the CPU, it needs to put the starting address of the page directory into a register (because the virtual address translation process requires an offset).
The working process of MMU: CPU obtains the virtual address–>MMU queries the page directory–>MMU queries the page table–>MMU obtains the page table entry–> MMU obtains the physical page number–>MMU obtains the physical address.
The above is the detailed content of What is the principle of Linux kernel page table and page table cache?. For more information, please follow other related articles on the PHP Chinese website!