1 / 4

Virtual Memory (Sec. 5.7)

Virtual Memory (Sec. 5.7). Two Major Motivations: Allow efficient and safe sharing of memory among multiple programs Allow a single program to exceed the size of main memory Some Terminology: A virtual memory block is called a page A miss is called a p age fault

Download Presentation

Virtual Memory (Sec. 5.7)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Virtual Memory (Sec. 5.7) Two Major Motivations: • Allow efficient and safe sharing of memory among multiple programs • Allow a single program to exceed the size of main memory Some Terminology: • A virtual memory block is called a page • A miss is called a page fault • The CPU produces a virtual address, which is translated to a physical address • A physical address is used to access the main memory

  2. 31 30 - - - - - - - - - 12 11 - - - -- - - - - - - 0 Virtual Page No. Physical Page No. Page off set Page off set Translate 29 28 12 11 0 Mapping Virtual Address to Physical Address Virtual Address Physical Address Page size = 4 KB Virtual address space = 4 GB Physical address space = 1 GB

  3. Page Table • Penalty for a page fault is very high • So, we optimize page placement to reduce fault rate • Hence, motivation to use fully associative placement • Pages are located using a ‘page table’ • Page table is indexed with the page number of Virtual Addresses and contains the page numbers of Physical Addresses as data • Each program has its own page table

  4. Fast Address Translation – Translation Look-aside Buffer (TLB) • A special cache is used for address translation, called Translation Look-aside Buffer (TLB) • Each tag entry of TLB holds portion of virtual page number • Each data entry of TLB holds a physical page number • On every reference, the TLB is searched to find the desired virtual page number • If it is a hit, continue • If it is a miss, check the Page Table • If it is a page fault, go to exception handling • If no page fault, load the TLB with the desired entry

More Related