当前位置:网站首页>Reverse mapping of anonymous pages
Reverse mapping of anonymous pages
2022-06-28 08:08:00 【HZero. chen】

The establishment process of reverse mapping
When passed fork When creating a subprocess , In this process, the infrastructure of reverse mapping will be established , Specific in
kernel_clone -》 copy_mm -》 dup_mm -》 dup_mmap in :
- dup_mmap Each of the parent processes vma Copy one to the child process , This is just an example of copying a vma The situation of , As shown in the figure above, the neutron process vma
- anon_vma_clone To create a child process avc01, It is also associated with the parent process av0 And subprocess vma Establishing correlation , That is, to join the child process vma Linked list , Connect to the parent process at the same time av0 Red and black trees , It is added to the parent process as a representative of the child process av0 Red and black trees , When the parent process looks for the reverse mapping in the future , Will traverse this red black tree , And get vma, When a child process is reverse mapped , Just traverse yourself av Red and black trees , This improves efficiency ;
- adopt anon_vma_alloc Assign your own to the child process av1, It is related to the parent process av0 Form a father son relationship ;
- adopt anon_vma_chain_alloc Assign your own to the child process avc1;
- adopt anon_vma_chain_link Set up a subprocess av1, avc1, vma The associated
notes : Above av by strucdt anon_vma, avc by anon_vma_chain
Reverse mapping lookup process
- adopt page Of mapping Field found av;
- Traverse av Red and black trees , Find all avc;
- adopt avc Find the corresponding vma, And pass vma find vma_start, And vm_mm And find out pgd;
- adopt page->index and vma_start Get the starting address of the virtual page ;
- Through the starting address of the virtual page and pgd find pte
Reference documents
《Linux Kernel depth parsing 》
《 In depth understanding of Linux Kernel reverse mapping mechanism 》
边栏推荐
- Configuring multiple instances of MySQL under Linux
- B_ QuRT_ User_ Guide(30)
- Redis cerebral fissure
- Unity - Pico开发 输入系统等相关API的使用---C#篇
- ROS 笔记(09)— 参数的查询和设置
- Cloud native: cloud computing technology is upgraded again to open an era of comprehensive cloud development
- 【学习笔记】模拟
- Host is not allowed to connect to this MySQL server
- ROS notes (08) - definition and use of service data
- Soft exam -- software designer -- afternoon question data flow diagram DFD
猜你喜欢
随机推荐
Uvcgan: unt vision transformer cycle-consistent Gan for unpropared image-to-image translation
B_ QuRT_ User_ Guide(30)
协程、asyncio、异步编程
How to insert a single quotation mark into a table as a data type in Oracle pl/sql
How redis solves cache avalanche, breakdown and penetration problems
HJ string sort
Configuring multiple instances of MySQL under Linux
B_QuRT_User_Guide(29)
ROS notes (09) - query and setting of parameters
云原生:云计算技术再次升级 开启全面云开发时代
sql主从复制搭建
Prometheus monitoring (I)
The solution of "user account control to continue, please enter administrator user name and password" appears in win10 Professional Edition
【学习笔记】模拟
关于在cmd中MySQL不能插中文数据的原因
MySQL tablespace parsing
关于如何在placeholder中使用字体图标
Do you know TCP protocol (1)?
B_QuRT_User_Guide(30)
[shangpinhui] project notes









