SlideShare a Scribd company logo
1 of 30
Implementation & Structure of Page Table
Agenda Page Table Definition Implementation of Page Table Hardware Support Paging Hardware With TLB Memory Protection Page Table Structure Hierarchical Paging Shared Pages Inverted Page Tables Hashed Page Tables
Page Table Definition A page table is the data structure used by a virtual memory system in a computer operating system  to store the mapping between  virtual addresses and physical  addresses
Two concern to discuss Implementation of Page Table concerning  about the access time of page table and load it to main memory Page Table Structure 	concerning  about the page table size & structure implementation
Implementation of Page Table(Hardware Support) The hardware implementation of the page table can be done in several ways.  In the simplest case, the page table is implemented as a set of dedicated registers. These registers should be built with very high-speed logic to make the paging-address translation efficient. Problem with page size…..
Hardware Support Page table is kept in main memory. Page-table base register (PTBR) points to the page table. Page-table length register (PRLR) indicates size of the page table. In this scheme every data/instruction access requires two memory accesses. One for the page table and one for the data/instruction Problem with access time…..
Paging Hardware With TLB The CPU's memory management unit (MMU) stores a cache of recently used mappings from the operating system's page table. This is called the translation look a side buffer (TLB).
Paging Hardware With TLB The TLB may reside between the CPU and the CPU cache, between the CPU cache and primary storage memory, or between levels of a multi-level cache. The TLB is typically implemented as content-addressable memory (CAM). The TLB is associative, high-speed memory. Each entry in the TLB consists of two parts: 	a key (or tag) and a value.
Paging Hardware With TLB Associative memory – parallel search  Address translation (A´, A´´) If A´ is in associative register, get frame # out.  Otherwise get frame # from page table in memory Page # Frame #
Paging Hardware With TLB TLB Hit TLB Miss If the TLB is already full of entries, the operating system must select one for replacement address-space identifiers (ASIDs) Page fault
Paging Hardware With TLB
Paging Hardware With TLB Effective Access Time Associative Lookup =  time unit Assume memory cycle time is 1 microsecond Hit ratio – percentage of times that a page number is found in the associative registers; ration related to number of associative registers. Hit ratio =  Effective Access Time (EAT) 		EAT = (1 + )  + (2 + )(1 – ) 			= 2 +  – 
Paging Hardware With TLB Suppose:  TLB lookup takes 5 nano sec.  Memory access time is 100 nano sec.  Hit ratio (probability to find page number in TLB) is ?  Effective Access Time = (5+100)* ? +( 5+100+100)*(1- ?) Suppose ? = 80% (for example, TLB size = 16)  	EAT = 105*.8 + 205*.2 = 125 nano sec.  	Suppose ? = 98% (for example, TLB size = 64)  	EAT = 105*.98 + 205*.02 = 107 nano sec
Memory Protection Memory protection implemented by associating protection bit with each frame. -One bit can define a page to be read-rite or read-only Valid-invalid bit attached to each entry in the page table: “valid” indicates that the associated page is in the process’ logical address space, and is thus a legal page. “invalid” indicates that the page is not in the process’ logical address space. page-table length register (PTLR), to indicate the size  of the page table.
Memory Protection
Page Table Structure Most modern computer systems support a large logical address space(2^32 to 2^64). In such an environment, the page table itself becomes excessively large. For example, consider a system with a 32-bit logical address space. If the page size in such a system is 4 KB (212 ), then a page table may consist of up to 1 million entries (2^32/2^12). Assuming that each entry consists of 4 bytes, each process may need up to 4 MB of physical address space for the page table alone.
Hierarchical Page Tables Knowing  as Multilevel Paging The page table might be too big to fit in a contiguous space, so we may have a hierarchy with several levels Break up the logical address space into multiple page tables. A simple technique is a two-level page table, three-level page table.
Two-Level Page-Table Scheme
Two-Level Paging Example A logical address (on 32-bit machine with 4K page size) is divided into: a page number consisting of 20 bits. a page offset consisting of 12 bits. Since the page table is paged, the page number is further divided into: a 10-bit page number.  a 10-bit page offset. Thus, a logical address is as follows:where pi is an index into the outer page table, and p2 is the displacement within the page of the outer page table. page number page offset p2 pi d 10 12 10
Three-Level Paging Example A logical address (on 64-bit machine with 4K page size) is divided into: The next step Would be a four-level paging scheme,
Address-Translation Scheme Address-translation scheme for a two-level 32-bit paging architecture
Performance of Hierarchical Paging Suppose:  Three level paging  TLB lookup takes 5 nano sec.  Memory access time is 100 nano sec.  Hit ratio (probability to find page number in TLB) is ?  Effective Access Time = (5+100)* ? +( 5+300+100)*(1- ?) Suppose ? = 80% (for example, TLB size = 16)  	-EAT = 105*.8 + 405*.2 = 165 nano sec. Suppose ? = 98% (for example, TLB size = 64)  	-EAT = 105*.98 + 405*.02 = 111 nano sec.
Shared Pages Shared code One copy of read-only (reentrant) code shared among processes (i.e., text editors, compilers, window systems).  Shared code must appear in same location in the logical address space of all processes. Private code and data  Each process keeps a separate copy of the code and data. The pages for the private code and data can appear anywhere in the logical address space.
Shared Pages Example
Inverted Page Table The inverted page table (IPT) combines a page table and a frame table into one data structure. One entry for each virtual page number  & real page of memory. Entry consists of the virtual address of the page stored in that real memory location, with information about the process that owns that page. Decreases memory needed to store each page table, but increases time needed to search the table when a page reference occurs.
Inverted Page Table Use hash table to limit the search to one — or at most a few — page-table entries. Say goodbye to sharing ?  	-because there is only one virtual page entry for every  physical page, one physical page cannot have two (or more) shared virtual addresses.
Inverted Page Table Architecture
Hashed Page Tables Common in address spaces > 32 bits. The virtual page number is hashed into a page table. This page table contains a chain of elements hashing to the same location. Each element consists of three fields:  (1) the virtual page number, (2) the value of the 111apped page frame, 	(3) a pointer to the next element in the linked list. Virtual page numbers are compared in this chain searching for a match. If a match is found, the corresponding physical frame is extracted.
Hashed Page Table
THANK YOU

More Related Content

What's hot (20)

Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
 
Memory management
Memory managementMemory management
Memory management
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
 
Cache memory
Cache memoryCache memory
Cache memory
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Computer organization memory
Computer organization memoryComputer organization memory
Computer organization memory
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Cache memory
Cache memoryCache memory
Cache memory
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Unix.system.calls
Unix.system.callsUnix.system.calls
Unix.system.calls
 
Stack organization
Stack organizationStack organization
Stack organization
 
Computer architecture memory system
Computer architecture memory systemComputer architecture memory system
Computer architecture memory system
 
Cache memory principles
Cache memory principlesCache memory principles
Cache memory principles
 
Quick sort-Data Structure
Quick sort-Data StructureQuick sort-Data Structure
Quick sort-Data Structure
 
Binary Search
Binary SearchBinary Search
Binary Search
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
parallel Questions & answers
parallel Questions & answersparallel Questions & answers
parallel Questions & answers
 
Basic Computer Organization and Design
Basic  Computer  Organization  and  DesignBasic  Computer  Organization  and  Design
Basic Computer Organization and Design
 

Similar to Implementation of page table

Csc4320 chapter 8 2
Csc4320 chapter 8 2Csc4320 chapter 8 2
Csc4320 chapter 8 2bshikhar13
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OSC.U
 
Operating system 35 paging
Operating system 35 pagingOperating system 35 paging
Operating system 35 pagingVaibhav Khanna
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003Prashant odhavani
 
Virtual memory translation.pptx
Virtual memory translation.pptxVirtual memory translation.pptx
Virtual memory translation.pptxRAJESH S
 
Week-13-Memory Managementggvgjjjbbbb.ppt
Week-13-Memory Managementggvgjjjbbbb.pptWeek-13-Memory Managementggvgjjjbbbb.ppt
Week-13-Memory Managementggvgjjjbbbb.pptTanyaSharma662971
 
Chapter 04
Chapter 04Chapter 04
Chapter 04 Google
 
Operating System- Multilevel Paging, Inverted Page Table
Operating System- Multilevel Paging, Inverted Page TableOperating System- Multilevel Paging, Inverted Page Table
Operating System- Multilevel Paging, Inverted Page TableZishan Mohsin
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptxSourabhRaj29
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptxItechAnand1
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdfHarika Pudugosula
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptxRohitPaul71
 

Similar to Implementation of page table (20)

Ppt
PptPpt
Ppt
 
Memory+management
Memory+managementMemory+management
Memory+management
 
Csc4320 chapter 8 2
Csc4320 chapter 8 2Csc4320 chapter 8 2
Csc4320 chapter 8 2
 
OSCh9
OSCh9OSCh9
OSCh9
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
Operating system 35 paging
Operating system 35 pagingOperating system 35 paging
Operating system 35 paging
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003
 
Memory management
Memory managementMemory management
Memory management
 
Virtual memory translation.pptx
Virtual memory translation.pptxVirtual memory translation.pptx
Virtual memory translation.pptx
 
Week-13-Memory Managementggvgjjjbbbb.ppt
Week-13-Memory Managementggvgjjjbbbb.pptWeek-13-Memory Managementggvgjjjbbbb.ppt
Week-13-Memory Managementggvgjjjbbbb.ppt
 
Chapter 04
Chapter 04Chapter 04
Chapter 04
 
Operating System- Multilevel Paging, Inverted Page Table
Operating System- Multilevel Paging, Inverted Page TableOperating System- Multilevel Paging, Inverted Page Table
Operating System- Multilevel Paging, Inverted Page Table
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
 
Paging.ppt
Paging.pptPaging.ppt
Paging.ppt
 
Ch8
Ch8Ch8
Ch8
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
 

Recently uploaded

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Implementation of page table

  • 2. Agenda Page Table Definition Implementation of Page Table Hardware Support Paging Hardware With TLB Memory Protection Page Table Structure Hierarchical Paging Shared Pages Inverted Page Tables Hashed Page Tables
  • 3. Page Table Definition A page table is the data structure used by a virtual memory system in a computer operating system to store the mapping between virtual addresses and physical addresses
  • 4. Two concern to discuss Implementation of Page Table concerning about the access time of page table and load it to main memory Page Table Structure concerning about the page table size & structure implementation
  • 5. Implementation of Page Table(Hardware Support) The hardware implementation of the page table can be done in several ways. In the simplest case, the page table is implemented as a set of dedicated registers. These registers should be built with very high-speed logic to make the paging-address translation efficient. Problem with page size…..
  • 6. Hardware Support Page table is kept in main memory. Page-table base register (PTBR) points to the page table. Page-table length register (PRLR) indicates size of the page table. In this scheme every data/instruction access requires two memory accesses. One for the page table and one for the data/instruction Problem with access time…..
  • 7. Paging Hardware With TLB The CPU's memory management unit (MMU) stores a cache of recently used mappings from the operating system's page table. This is called the translation look a side buffer (TLB).
  • 8. Paging Hardware With TLB The TLB may reside between the CPU and the CPU cache, between the CPU cache and primary storage memory, or between levels of a multi-level cache. The TLB is typically implemented as content-addressable memory (CAM). The TLB is associative, high-speed memory. Each entry in the TLB consists of two parts: a key (or tag) and a value.
  • 9. Paging Hardware With TLB Associative memory – parallel search Address translation (A´, A´´) If A´ is in associative register, get frame # out. Otherwise get frame # from page table in memory Page # Frame #
  • 10. Paging Hardware With TLB TLB Hit TLB Miss If the TLB is already full of entries, the operating system must select one for replacement address-space identifiers (ASIDs) Page fault
  • 12. Paging Hardware With TLB Effective Access Time Associative Lookup =  time unit Assume memory cycle time is 1 microsecond Hit ratio – percentage of times that a page number is found in the associative registers; ration related to number of associative registers. Hit ratio =  Effective Access Time (EAT) EAT = (1 + )  + (2 + )(1 – ) = 2 +  – 
  • 13. Paging Hardware With TLB Suppose: TLB lookup takes 5 nano sec. Memory access time is 100 nano sec. Hit ratio (probability to find page number in TLB) is ? Effective Access Time = (5+100)* ? +( 5+100+100)*(1- ?) Suppose ? = 80% (for example, TLB size = 16) EAT = 105*.8 + 205*.2 = 125 nano sec. Suppose ? = 98% (for example, TLB size = 64) EAT = 105*.98 + 205*.02 = 107 nano sec
  • 14. Memory Protection Memory protection implemented by associating protection bit with each frame. -One bit can define a page to be read-rite or read-only Valid-invalid bit attached to each entry in the page table: “valid” indicates that the associated page is in the process’ logical address space, and is thus a legal page. “invalid” indicates that the page is not in the process’ logical address space. page-table length register (PTLR), to indicate the size of the page table.
  • 16. Page Table Structure Most modern computer systems support a large logical address space(2^32 to 2^64). In such an environment, the page table itself becomes excessively large. For example, consider a system with a 32-bit logical address space. If the page size in such a system is 4 KB (212 ), then a page table may consist of up to 1 million entries (2^32/2^12). Assuming that each entry consists of 4 bytes, each process may need up to 4 MB of physical address space for the page table alone.
  • 17. Hierarchical Page Tables Knowing as Multilevel Paging The page table might be too big to fit in a contiguous space, so we may have a hierarchy with several levels Break up the logical address space into multiple page tables. A simple technique is a two-level page table, three-level page table.
  • 19. Two-Level Paging Example A logical address (on 32-bit machine with 4K page size) is divided into: a page number consisting of 20 bits. a page offset consisting of 12 bits. Since the page table is paged, the page number is further divided into: a 10-bit page number. a 10-bit page offset. Thus, a logical address is as follows:where pi is an index into the outer page table, and p2 is the displacement within the page of the outer page table. page number page offset p2 pi d 10 12 10
  • 20. Three-Level Paging Example A logical address (on 64-bit machine with 4K page size) is divided into: The next step Would be a four-level paging scheme,
  • 21. Address-Translation Scheme Address-translation scheme for a two-level 32-bit paging architecture
  • 22. Performance of Hierarchical Paging Suppose: Three level paging TLB lookup takes 5 nano sec. Memory access time is 100 nano sec. Hit ratio (probability to find page number in TLB) is ? Effective Access Time = (5+100)* ? +( 5+300+100)*(1- ?) Suppose ? = 80% (for example, TLB size = 16) -EAT = 105*.8 + 405*.2 = 165 nano sec. Suppose ? = 98% (for example, TLB size = 64) -EAT = 105*.98 + 405*.02 = 111 nano sec.
  • 23. Shared Pages Shared code One copy of read-only (reentrant) code shared among processes (i.e., text editors, compilers, window systems). Shared code must appear in same location in the logical address space of all processes. Private code and data Each process keeps a separate copy of the code and data. The pages for the private code and data can appear anywhere in the logical address space.
  • 25. Inverted Page Table The inverted page table (IPT) combines a page table and a frame table into one data structure. One entry for each virtual page number & real page of memory. Entry consists of the virtual address of the page stored in that real memory location, with information about the process that owns that page. Decreases memory needed to store each page table, but increases time needed to search the table when a page reference occurs.
  • 26. Inverted Page Table Use hash table to limit the search to one — or at most a few — page-table entries. Say goodbye to sharing ? -because there is only one virtual page entry for every physical page, one physical page cannot have two (or more) shared virtual addresses.
  • 27. Inverted Page Table Architecture
  • 28. Hashed Page Tables Common in address spaces > 32 bits. The virtual page number is hashed into a page table. This page table contains a chain of elements hashing to the same location. Each element consists of three fields: (1) the virtual page number, (2) the value of the 111apped page frame, (3) a pointer to the next element in the linked list. Virtual page numbers are compared in this chain searching for a match. If a match is found, the corresponding physical frame is extracted.

Editor's Notes

  1. If we want to access location i, we must first index into the page table, using the value in the PTBR offset by the page number for ch8/8.This task requires a memory access. It provides us with the frame number which is combined with the page offset to produce the actual address. We can then access the desired place in memory
  2. MMU is a computer hardware component responsible for handling accesses to memory requested by the CPU. Its functions include translation of virtual addresses to physical addresses, memory protection, cache control
  3. Content-addressable memory (CAM) is a special type of computer memory used in certain very high speed searching applicationsUnlike standard computer memory (random access memory or RAM) in which the user supplies a memory address and the RAM returns the data word stored at that address, a CAM is designed such that the user supplies a data word and the CAM searches its entire memory to see if that data word is stored anywhere in it
  4. When the associative memory is presented with an item, the item is compared with all keys simultaneously. If the item is found,the corresponding value field is returned
  5. -When a logical address is generated by the CPU, its page number is presented to the TLB. If the page number is found , its frame number is immediately available and is used to access memory. The whole task may take less than 10 percent longer than it would if an unmappedmemory reference were used. If the page number is not in the TLB (known as a TLB miss)-In addition, we add the page number and frame number to the TLB, so that they will be found quickly on the next reference.-Some TLBs store address-space identifiers (ASIDs) in each TLB entry. An ASID uniquely identifies each process and is used to provide address-space protection for that process. When the TLB attempts to resolve virtual page numbers, it ensures that the ASID for the currently running process matches the ASID associated with the virtual page. If the ASIDs do not match, the attempt is treated as a TLB miss.-If the TLB is already full of entries, the operating system must select one for replacement. Replacement policies range from least recently used (LRU) to random.-page fault is an interrupt (or exception) to the software raised by the hardware, when a program accesses a page that is mapped in address space, but not loaded in physical memory
  6. .
  7. in the form of a page-table length register (PTLR), to indicate the size of the page table. This value is checked against every logical address to verify that the address is in the valid range for the process. Failure of this test causes an error trap to the operating system
  8. The inverted page table (IPT) combines a page table and a frame table into one data structure at its core is a fixed-size table with the number of rows associating to each frame in memory. If there were 4000 frames, the inverted page table has 4000 rows. For each row there is an entry for the virtual page number (VPN), the physical page number (not the physical address), some other data and a means for creating a collision chain,
  9. A simple technique for addressing this issue is to allow the page table to contain only one mapping of a virtual address to the shared physical address. This meansthat references to virtual addresses that are not mapped result in page faults.