Home > Operation and Maintenance > Linux Operation and Maintenance > What is the principle of Linux kernel page table and page table cache?

What is the principle of Linux kernel page table and page table cache?

WBOY
Release: 2023-05-14 14:52:06
forward
1560 people have browsed it

1. Related concepts

[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.

2. Page table entry

(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:

What is the principle of Linux kernel page table and page table cache?

(2) Physical address (page frame number, offset). The mapping relationship is as follows:

What is the principle of Linux kernel page table and page table cache?

3. Page table cache

[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.

What is the principle of Linux kernel page table and page table cache?

4. Their relationship

  1. The page table is composed of multiple page table entries, and each row in the page table is a page table entry.

  2. Page frame number: specially used to store the physical page corresponding to the virtual page.

  3. Page table entries are designed by hardware.

  4. 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).

  5. 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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template