📜  页表和倒排页表的区别

📅  最后修改于: 2022-05-13 01:56:11.656000             🧑  作者: Mango

页表和倒排页表的区别

分页是操作系统中存储管理的概念,它从辅助存储中检索进程并将它们作为页面存储在主内存中。分页背后的主要概念是将每个进程划分为页面。帧也将用于划分主存储器。

进程的一页将保存在其中一个内存帧中。在各个位置,我们可以将页面存储在整个内存中,但我们的优先级始终是找到连续的帧。 Page Table 存储进程页面所在的帧号。 Page Table Entry 包含各种与页面相关的信息。

页表:

对于每个进程,操作系统都保留一个页表。每个进程都有自己的页表,我们不需要在页表中存储任何进程标识符。页表是将给定的逻辑/虚拟页号转换为实际物理帧/页地址的表。

页表是虚拟内存系统使用的一个非常重要的部分,用于存储虚拟地址和物理地址之间的映射。在虚拟地址转换中,页表是非常重要的部分,它是访问内存中数据所必需的。

倒置页表:

在倒排页表中,每个占用的物理内存帧都有一个虚拟页。倒置页表是倒置的,这意味着我们查看从物理内存帧到虚拟页的映射,尽管实际地址转换以虚拟页开始并以物理内存帧结束,就像普通页一样桌子。

倒页表是操作系统为所有进程维护的单页表。倒排页表中的条目数和主存储器中的帧数相等。倒排页表用于克服页表的局限性。

无论该页面是否存在于主存储器中,总是为它保留一个空间。但是,如果页面不存在,这只是浪费内存。

页表和倒页表的区别

以下是倒排页表和页表之间的主要区别如下:

S. NoPage TableInverted Page Table
1Page Tables is an important part that is used by virtual memory systems, it is used to store the mapping between the logical and the physical addresses.In an inverted page table, there is a virtual page for each occupied physical memory frame. It can be used to overcome the limitations of the page table.
2For each process, the operating system keeps a page table.The Operating System maintains an inverted page table for all processes.
3

A memory reference’s logical address is of the form:

Logical Address:

A memory reference’s logical address is of the form:

Logical Address: = page-table[f]  

4Page Table is one type of data structure that is used by virtual memory systems.For faster lookup, inverted page tables can be implemented using a hash table data structure.
5There is a wastage of memory in the page table if the page is not present.We can minimize the wastage of memory by just inverting the page table.