Let us explore more about Hashed Page Tables and its working in this article.
Hashed Page Tables :
In hashed page tables, the virtual page number in the virtual address is hashed into the hash table. They are used to handle address spaces higher than 32 bits. Each entry in the hash table has a linked list of elements hashed to the same location (to avoid collisions – as we can get the same value of a hash function for different page numbers). The hash value is the virtual page number. The Virtual Page Number is all the bits that are not a part of the page offset.
For each element in the hash table, there are three fields –
- Virtual Page Number (which is the hash value).
- Value of the mapped page frame.
- A pointer to the next element in the linked list.
Hashed Page Table :
The virtual page number is compared with field 1 in the first element of the linked list. If it matches, the corresponding page frame (field 2) is used to form the desired physical address. Otherwise, subsequent entries in the linked list are checked until the virtual page number matches.
To make this algorithm suitable for 64-bit address spaces also, clustered page tables are used.
Clustered Page Tables are similar to hashed page tables except that each entry in the hash table refers to many pages rather than one single page (as in a hashed page table). Hence, a single entry of a clustered page table can store the mappings for multiple physical page frames.
Clustered page tables are specifically useful for sparse address spaces, where memory references are scattered throughout the address space (non-contiguous).
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Caching Page Tables
- Page Fault Handling in Operating System
- Inverted Page Table in Operating System
- Page Table Entries in Page Table
- System Protection in Operating System
- User View Vs Hardware View Vs System View of Operating System
- System Programs in Operating System
- File System Implementation in Operating System
- Xv6 Operating System -adding a new system call
- Traps and System Calls in Operating System (OS)
- Page Replacement Algorithms in Operating Systems
- Introduction of Deadlock in Operating System
- Thread in Operating System
- Paging in Operating System
- Banker's Algorithm in Operating System
- Segmentation in Operating System
- File Systems in Operating System
- Virtual Memory in Operating System
- Real Time Operating System (RTOS)
- Remote Procedure Call (RPC) in Operating System
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.