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

Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentationRanjeet Kumar
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating SystemRaj Mohan
 
Virtual memory
Virtual memoryVirtual memory
Virtual memoryAnuj Modi
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.Ravi Kumar Patel
 
Synchronization hardware
Synchronization hardwareSynchronization hardware
Synchronization hardwareSaeram Butt
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
FIFO, LRU, OPTIMAL Page Replacement Algorithm
FIFO, LRU, OPTIMAL Page Replacement AlgorithmFIFO, LRU, OPTIMAL Page Replacement Algorithm
FIFO, LRU, OPTIMAL Page Replacement AlgorithmArijitRoy118
 
Page Replacement Algorithms
Page Replacement AlgorithmsPage Replacement Algorithms
Page Replacement AlgorithmsKashif Dayo
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual MemoryArchith777
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory pptRITULDE
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryWayne Jones Jnr
 
Address translation-mechanism-of-80386 by aniket bhute
Address translation-mechanism-of-80386 by aniket bhuteAddress translation-mechanism-of-80386 by aniket bhute
Address translation-mechanism-of-80386 by aniket bhuteAniket Bhute
 

What's hot (20)

Virtual memory presentation
Virtual memory presentationVirtual memory presentation
Virtual memory presentation
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Memory management
Memory managementMemory management
Memory management
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Memory management
Memory managementMemory management
Memory management
 
Synchronization hardware
Synchronization hardwareSynchronization hardware
Synchronization hardware
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Memory management
Memory managementMemory management
Memory management
 
Memory management
Memory managementMemory management
Memory management
 
FIFO, LRU, OPTIMAL Page Replacement Algorithm
FIFO, LRU, OPTIMAL Page Replacement AlgorithmFIFO, LRU, OPTIMAL Page Replacement Algorithm
FIFO, LRU, OPTIMAL Page Replacement Algorithm
 
Page Replacement Algorithms
Page Replacement AlgorithmsPage Replacement Algorithms
Page Replacement Algorithms
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Evolution of os
Evolution of osEvolution of os
Evolution of os
 
Address translation-mechanism-of-80386 by aniket bhute
Address translation-mechanism-of-80386 by aniket bhuteAddress translation-mechanism-of-80386 by aniket bhute
Address translation-mechanism-of-80386 by aniket bhute
 

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
 
Hardware implementation of page table
Hardware implementation of page table Hardware implementation of page table
Hardware implementation of page table Sukhraj Singh
 
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
 
Hardware implementation of page table
Hardware implementation of page table Hardware implementation of page table
Hardware implementation of page table
 
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
 
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

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.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.