简体   繁体   English

对象WMA(虚拟内存区域:)和PTE(页表项)之间有什么区别?

[英]What is the difference between objects WMA (Virtual Memory Area:) and PTE (Page Table Entry)?

对象WMA(用于运行内核Linux的虚拟内存区: struct vm_area_struct )和PTE(用于操作MMU的页表项)之间有什么区别,为什么我们需要WMA而没有足够的PTE?

The virtual memory address space of each process is divided into virtual memory areas (VMAs) where all the memory in one VMA is contiguous and shares certain properties such as permissions. 每个进程的虚拟内存地址空间被划分为虚拟内存区域(VMA),其中一个VMA中的所有内存都是连续的,并共享某些属性,例如权限。 For example, a process might have one VMA for its code, one VMA for each type of data, one VMA for each distinct memory mapping (if any), etc. 例如,一个进程可能为其代码使用一个VMA,对于每种数据类型使用一个VMA,对于每个不同的内存映射(如果有)使用一个VMA,等等。

Each VMA consists of a number of pages, where a page is the unit for moving between main physical memory and backing store. 每个VMA均由多个页面组成,其中页面是在主物理内存和后备存储之间移动的单元。

Each page has an entry in the Page Table, to indicate whether the page is currently in physical memory (in which case it points to the physical memory address of the page) or currently “paged out” on the system's backing storage (in which case it points to the backing storage address of the page copy). 每个页面在“页面表”中都有一个条目,以指示该页面当前是在物理内存中(在这种情况下它指向页面的物理内存地址)还是当前在系统的后备存储器上“被分页”(在这种情况下)它指向页面副本的后备存储地址)。

So each VMA has multiple PTEs. 因此,每个VMA具有多个PTE。

The function of the VMA is to define a contiguous area of virtual memory (contiguous virtual addresses, not contiguous physical addresses) with the correct permissions. VMA的功能是定义具有正确权限的虚拟内存的连续区域(连续的虚拟地址,而不是连续的物理地址)。

The function of the Page Table is to manage paging between main physical memory and backing store, and to be the communication point between the system/hardware (the MMU) and the OS software. 页表的功能是管理主物理内存和后备存储之间的分页,并且是系统/硬件(MMU)与OS软件之间的通信点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM