The Wayback Machine - https://web.archive.org/web/20240930184546/https://www.geeksforgeeks.org/page-table-entries-in-page-table/
Open In App

Page Table Entries in Page Table

Last Updated : 03 Aug, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

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.

A Page Table Entry (PTE) is an entry in the Page Table that stores information about a particular page of memory. Each PTE contains information such as the physical address of the page in memory, whether the page is present in memory or not, whether it is writable or not, and other access permissions.

The size and format of a PTE can vary depending on the architecture of the system and the operating system used. In general, a PTE contains enough information to allow the operating system to manage memory efficiently and protect the system from malicious or accidental access to memory.

Page Table Entry

Page Table Entry

The number of Page Table Entries in a Page Table depends on the size of the virtual address space used by a process and the size of the memory pages used by the system. For example, if the virtual address space of a process is 32 bits, and the system uses 4 KB pages, then the Page Table will have 2^20 (1 million) entries, with each entry being 4 bytes in size.

In modern systems with large virtual address spaces, such as 64-bit systems, the Page Table can become very large, leading to performance issues. To address this, some systems use hierarchical page tables, where the Page Table is divided into smaller tables, each pointing to a larger table. This allows for more efficient memory management and faster access to Page Table Entries.

Information Stored in Page Table Entry

  • Frame Number – It gives the frame number in which the current page you are looking for is present. The number of bits required depends on the number of frames. Frame bit is also known as address translation bit.

Number of bits for frame = Size of physical memory / Frame Size

  • Present/Absent Bit: Present or absent bit says whether a particular page you are looking for is present or absent. In case it is not present, that is called Page Fault. It is set to 0 if the corresponding page is not in memory. Used to control page faults by the operating system to support virtual memory. Sometimes this bit is also known as a valid/invalid bit.
  • Protection Bit: The protection bit says what kind of protection you want on that page. So, these bits are for the protection of the page frame (read, write, etc).
  • Referenced Bit: Referenced bit will say whether this page has been referred to in the last clock cycle or not. It is set to 1 by hardware when the page is accessed.
  • Caching Enabled/Disabled: Sometimes we need fresh data. Let us say the user is typing some information from the keyboard and your program should run according to the input given by the user. In that case, the information will come into the main memory. Therefore main memory contains the latest information which is typed by the user. Now if you try to put that page in the cache, that cache will show the old information. So whenever freshness is required, we don’t want to go for caching or many levels of memory. The information present in the closest level to the CPU and the information present in the closest level to the user might be different. So we want the information to be consistent, which means whatever information the user has given, the CPU should be able to see it as first as possible. That is the reason we want to disable caching. So, this bit enables or disables caching of the page.
  • Modified Bit: Modified bit says whether the page has been modified or not. Modified means sometimes you might try to write something onto the page. If a page is modified, then whenever you should replace that page with some other page, then the modified information should be kept on the hard disk or it has to be written back or it has to be saved back. It is set to 1 by hardware on the write-access to a page which is used to avoid writing when swapped out. Sometimes this modified bit is also called the Dirty bit.

Advantages of Using a Page Table in a Virtual Memory System

  • Efficient Use of Memory: Virtual memory allows the operating system to allocate only the necessary amount of physical memory needed by a process, which reduces memory waste and increases overall system performance.
  • Protection: Page Tables allow the operating system to control access to memory and protect sensitive data from unauthorized access. Each PTE can be configured with access permissions, such as read-only or no access, to prevent accidental or malicious modification of memory.
  • Flexibility: Virtual memory allows multiple processes to share the same physical memory space, which increases system flexibility and allows for better resource utilization.
  • Address Translation: Page Tables provide the mechanism for translating virtual addresses used by a process into physical addresses in memory, which allows for efficient use of memory and simplifies memory management.
  • Hierarchical Design: Some systems use hierarchical page tables, which provide a more efficient method for managing large virtual address spaces. Hierarchical page tables divide the Page Table into smaller tables, each pointing to a larger table, which allows for faster access to Page Table Entries and reduces the overall size of the Page Table.

Questions For Practice

1. Consider a machine with 64 MB of physical memory and a 32-bit virtual address space. If the page size is 4KB, what is the approximate size of the page table? (GATE CS 2001)

(A) 16 MB

(B) 8MB

(C) 2MB

(D) 24 MB

Solution: Correct Answer is (C).

For a detailed solution, refer to GATE CS 2001, Question 46.

2. In a virtual memory system, the size of the virtual address is 32-bit, the size of the physical address is 30-bit, the page size is 4 Kbyte, and the size of each page table entry is 32-bit. The main memory is byte addressable. Which one of the following is the maximum number of bits that can be used for storing protection and other information in each page table entry? (GATE CS 2004)

(A) 2

(B) 10

(C) 12

(D) 14

Solution: Correct Answer is (D).

For a detailed Solution, refer to GATE CS 2004, Question 66.

3. Consider a system with byte-addressable memory, 32-bit logical addresses, 4-kilobyte page sizes, and page table entries of 4 bytes each. The size of the page table in the system in megabytes is ___________. (GATE CS 2015)

(A) 2

(B) 4

(C) 8

(D) 16

Solution: Correct Answer is (B).

For a detailed solution, refer to GATE CS 2015 (Set 1), Question 65

FAQs On Page Table

Q.1: What happens in case the Page Table Entry is not present in the Page Table?

Answer:

If a Page Table Entry is not present in the Page Table, it leads to a page fault, and the Operating System has to bring the required page from the disk into memory.

Q.2: Can we modify the page table entry during the runtime?

Answer:

Yes, we can easily modify the page table entries during runtime for changing the mapping functionality.

Q.3: Can you specify the purpose of the Page Table Directory?

Answer:

The purpose of the Page Global Directory is to locate the page middle directory in a multi-level paging system.



Previous Article
Next Article

Similar Reads

Difference Between Page Table and Inverted Page Table
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
5 min read
Optimal Page Replacement Algorithm
Prerequisite: Page Replacement Algorithms In operating systems, whenever a new page is referred and not present in memory, page fault occurs and Operating System replaces one of the existing pages with newly needed page. Different page replacement algorithms suggest different ways to decide which page to replace. The target for all algorithms is to
15+ min read
Second Chance (or Clock) Page Replacement Policy
Prerequisite - Page Replacement Algorithms Apart from LRU, OPT and FIFO page replacement policies, we also have the second chance/clock page replacement policy. In the Second Chance page replacement policy, the candidate pages for removal are considered in a round robin matter, and a page that has been accessed between consecutive considerations wi
15+ min read
Implementation of Least Recently Used (LRU) page replacement algorithm using Counters
Prerequisite - Least Recently Used (LRU) Page Replacement algorithm Least Recently Used page replacement algorithm replaces the page which is not used recently. Implementation: In this article, LRU is implemented using counters, a ctime (i.e., counter) variable is used to represent the current time, it is incremented for every page of the reference
8 min read
Caching Page Tables
Paging is a memory management scheme which allows physical address space of a process to be non-contiguous. The basic idea of paging is to break physical memory into fixed-size blocks called frames and logical memory into blocks of same size called pages. While executing the process the required pages of that process are loaded into available frame
6 min read
Advantages and Disadvantages of various Page Replacement algorithms
Page Scheduling, involves many different algorithms which have their Advantages and Disadvantages. 1. First In First Out (FIFO): Advantages -It is simple and easy to understand & implement.It is efficiently used for small systemsIt does not cause more overheadsSimplicity: FIFO is a simple and easy-to-implement algorithm. It does not require com
6 min read
Not Recently Used (NRU) page replacement algorithm
It is a page replacement algorithm. This algorithm removes a page at random from the lowest numbered non-empty class. Implicit in this algorithm is that it is better to remove a modified page that has not been referenced in atleast one clock tick than a clean page that is in heavy use. It is easy to understand, moderately efficient to implement and
3 min read
Page Faults in LFU | Implementation
In this, it is using the concept of paging for memory management, a page replacement algorithm is needed to decide which page needs to be replaced when the new page comes in. Whenever a new page is referred to and is not present in memory, the page fault occurs and the Operating System replaces one of the existing pages with a newly needed page. LF
12 min read
Page Buffering Algorithm in Operating System
The Page Buffering Algorithm is used in Operating systems and Database Management Systems as a key method to streamline data access and minimize disc I/O operations. It is largely used in virtual memory systems, where data is kept on secondary storage (disc) and brought into main memory as needed. The Page Buffering Algorithm's primary goal is to r
7 min read
Difference Between LRU and FIFO Page Replacement Algorithms in Operating System
Page replacement algorithms are used in operating systems to manage memory effectively. Page replacement algorithms are essential in operating systems for efficient memory management. These algorithms select which memory pages should be changed when a new page is brought. Least Recently Used (LRU) and First-In-First-Out (FIFO) are two popular page
3 min read
Hashed Page Tables in Operating System
There are several common techniques for structuring page tables like Hierarchical Paging, Hashed Page Tables, and Inverted Page Tables. In this article, we will discuss the Hashed Page Table. Hashed Page Tables are a type of data structure used by operating systems to efficiently manage memory mappings between virtual and physical memory addresses.
4 min read
Counting Based Page Replacement Algorithm in Operating System
Counting Based Page Replacement Algorithm replaces the page based on count i.e. number of times the page is accessed in the past. If more than one page has the same count, then the page that occupied the frame first would be replaced. Page Replacement: Page Replacement is a technique of replacing a data block (frame) of Main Memory with the data bl
5 min read
Program for Least Recently Used (LRU) Page Replacement algorithm
Prerequisite: Page Replacement AlgorithmsIn operating systems that use paging for memory management, page replacement algorithm are needed to decide which page needed to be replaced when new page comes in. Whenever a new page is referred and not present in memory, page fault occurs and Operating System replaces one of the existing pages with newly
14 min read
Belady's Anomaly in Page Replacement Algorithms
In the Operating System, process data is loaded in fixed-sized chunks and each chunk is referred to as a page. The processor loads these pages in fixed-sized chunks of memory called frames. Typically the size of each page is always equal to the frame size. A page fault occurs when a page is not found in the memory and needs to be loaded from the di
10 min read
Page Fault Handling in Operating System
A page fault occurs when a program attempts to access data or code that is in its address space but is not currently located in the system RAM. This triggers a sequence of events where the operating system must manage the fault by loading the required data from secondary storage into RAM. Page faults are essential for implementing virtual memory sy
5 min read
Page Replacement Algorithms in Operating Systems
In an operating system that uses paging for memory management, a page replacement algorithm is needed to decide which page needs to be replaced when a new page comes in. Page replacement becomes necessary when a page fault occurs and no free page frames are in memory. However, another page fault would arise if the replaced page is referenced again.
8 min read
Difference between page and block in operating system
In an operating system, a block is a variable-size storage that can either read a file or write data into a file. The page is a fixed-size memory unit that can be loaded into the processor from main memory. In this article, we will provide an overview of the page and block in the operating system and then discuss the differences by mentioning the f
7 min read
Page Faults in LRU | Implementation
LRU uses the concept of paging for memory management. A page replacement algorithm is needed to decide which page needs to be replaced when the new page comes in. Whenever a new page is referred to and is not present in memory, the page fault occurs and the Operating System replaces one of the existing pages with a newly needed page. LRU is one suc
15 min read
Decidability Table in Theory of Computation
Prerequisite - Undecidability, Decidable and undecidable problems Identifying languages (or problems*) as decidable, undecidable or partially decidable is a very common question in GATE. With correct knowledge and ample experience, this question becomes very easy to solve. A language is undecidable if it is not decidable. An undecidable language ma
2 min read
Construction of LL(1) Parsing Table
Prerequisite - Classification of top-down parsers, FIRST Set, FOLLOW Set A top-down parser builds the parse tree from the top down, starting with the start non-terminal. There are two types of Top-Down Parsers: Top-Down Parser with BacktrackingTop-Down Parsers without BacktrackingTop-Down Parsers without backtracking can further be divided into two
7 min read
Difference between Table-driven and Cyclic Scheduling
Clock-driven scheduling is the scheduling algorithm in which the scheduling points are determined by the clock interrupts. Clock-driven scheduling is of two types: 1. Table-driven Scheduling : In table-driven scheduling, the start timing of all tasks are precomputed and it is stored in a table at the time of configuration of the system. The table s
2 min read
Various implementations of Symbol Table
Symbol Table is an important data structure that is created and maintained by the compilers in order to track information about the occurrences of various entities such as variable names, objects, function names, interfaces, etc. The information that is collected by the compiler inside the symbol table in the analysis phase is used by the synthesis
3 min read
Closure properties Table in TOC
The Below Table shows the Closure Properties of Formal Languages : REG = Regular LanguageDCFL = deterministic context-free languages, CFL = context-free languages,CSL = context-sensitive languages,RC = Recursive.RE = Recursive Enumerable Consider L and M are regular languages : The Kleene star - ∑*, is a unary operator on a set of symbols or string
3 min read
Transition Table in Automata
Transition Table :Transition function(∂) is a function which maps Q * ∑ into Q . Here 'Q' is set of states and '∑' is input of alphabets. To show this transition function we use table called transition table. The table takes two values a state and a symbol and returns next state. A transition table gives the information about - Rows represent diffe
4 min read
What is a Master File Table?
Pre-requisites: File Systems in Operating System The Master File Table (MFT) is a system file in the NTFS file system (having the name $MFT) that stores metadata information about all files and directories on an NTFS volume. The MFT acts as an index to all the files and directories on the volume, providing quick access to the information needed to
3 min read
GATE 2025 Preparation Time Table: Monthly and Daily Plan
The Graduate Aptitude Test in Engineering(GATE) is one of the toughest competitive exams across India, that requires high concentration, dedication, and continuous smart work throughout the entire year to crack it. Competition is also increasing day by day in GATE. So, a candidate has to be very smart as well as equally knowledgeable to crack it. M
8 min read
Solving Algebraic Structures Problems by Composition Table
Algebraic structures are foundational concepts in abstract algebra, a branch of mathematics that studies the algebraic systems such as sets equipped with operations that combine elements in specific ways. These structures allow mathematicians to generalize arithmetic operations like addition and multiplication, leading to profound insights in vario
10 min read
Process Table and Process Control Block (PCB)
While creating a process, the operating system performs several operations. To identify the processes, it assigns a process identification number (PID) to each process. As the operating system supports multi-programming, it needs to keep track of all the processes. For this task, the process control block (PCB) is used to track the process’s execut
7 min read
Symbol Table in Compiler
Every compiler uses a major tool called the symbol table to keep track of all the variables, functions, and other identifiers a program may have. The symbol table will store the name, its type, and perhaps its memory locations to support the compiler in error checking, scope management, and the optimization of the code for runtime efficiency. What
10 min read
What is OSI Model? - Layers of OSI Model
OSI stands for Open Systems Interconnection , where open stands to say non-proprietary. It is a 7-layer architecture with each layer having specific functionality to perform. All these 7 layers work collaboratively to transmit the data from one person to another across the globe. The OSI reference model was developed by ISO - 'International Organiz
15+ min read
Article Tags :