Open In App

Difference Between Page Table and Inverted Page Table

Last Updated : 24 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Paging is a concept for storage management in operating systems that retrieve processes from secondary storage and store them in main memory as pages. The main concept behind paging is to divide each process into pages. Frames will also be used to divide the main memory.

One page of the process is to be saved in one of the memory frames. In various locations, we can store the page throughout the memory, but our priority is always to find contiguous frames. Page Table stores the frame number where the process’s pages are stored. Page Table Entry contains a variety of page-related information.

Page Table:

For each process, the operating system keeps a page table. Every process has their own page table, we did not need to store any process identifier in the page table. A page table is a table that converts a given logical/virtual page number to an actual physical frame/page address.

A page table is a very important part used by a virtual memory system that stores the mapping between virtual addresses and physical addresses. In the virtual address translation page table is the very important part, which is required to access data in memory.

Inverted Page Table:

In an inverted page table, there is a virtual page for each occupied physical memory frame. The inverted page table is inverted which means we look at the mapping from a physical memory frame back to a virtual page, despite the fact that the actual address translation begins with a virtual page and ends with a physical memory frame, just like a normal page table.

The Inverted Page Table is a one-page table that the Operating System maintains for all processes. The number of entries in an inverted page table and the number of frames are equal in the main memory. The inverted page table is used to overcome the limitations of the page table.

Whether or not the page is present in the main memory, there is always a space reserved for it. If the page is not present, however, this is simply a wastage of memory.

Difference between Page Table and Inverted Page Table

The following are the primary distinctions between an inverted page table and a page table are as follows:

S. No Page Table Inverted Page Table
1 Page 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.
2 For 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: <virtual page number (p), offset (d)>

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

Logical Address:<pid (id), virtual page number (p)> = page-table[f]  

4 Page 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.
5 There is a wastage of memory in the page table if the page is not present. We can minimise the wastage of memory by just inverting the page table.

Page Table and Inverted Page Table are two different data structures used in virtual memory systems to map virtual addresses to physical addresses.

Page Table:
A Page Table is a data structure used by the operating system to keep track of the mapping between virtual addresses used by a process and the corresponding physical addresses in the system’s memory. In a Page Table, each process has its own Page Table, which contains a mapping of the virtual addresses used by that process to the corresponding physical addresses in memory. Each entry in the Page Table (known as a Page Table Entry or PTE) contains information about a particular page of memory, such as the physical address of the page, whether the page is present in memory, and access permissions.

Inverted Page Table:
An Inverted Page Table is a data structure used by some operating systems to keep track of the mapping between physical addresses and the corresponding virtual addresses used by each process. In an Inverted Page Table, there is a single table that contains an entry for each physical page in memory. Each entry in the Inverted Page Table contains information about the corresponding virtual address(es) that map to that physical page, as well as information about the process that owns the virtual address(es).

The main difference between Page Table and Inverted Page Table is the way they store and manage the mapping information. In a Page Table, each process has its own table, and each entry in the table contains information about a particular virtual address. In contrast, an Inverted Page Table has a single table that contains entries for each physical page, and each entry contains information about the virtual addresses that map to that page.

The choice between using a Page Table or an Inverted Page Table depends on the specific requirements of the operating system and the hardware platform being used. Page Tables are more commonly used in most modern operating systems because they are more efficient for managing large virtual address spaces and provide better protection and control over memory access. However, Inverted Page Tables can be useful in certain scenarios, such as systems with limited memory resources, where the system needs to track the usage of physical pages more closely.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads