L9-10_VM_2010

L9-10_VM_2010 - Computer Architecture Virtual Memory Dr....

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Architecture 2010 – VM 1 Computer Architecture Virtual Memory Dr. Lihu Rappoport
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer Architecture 2010 – VM 2 Virtual Memory Provides the illusion of a large memory Different machines have different amount of physical memory Allows programs to run regardless of actual physical memory size The amount of memory consumed by each process is dynamic Allow adding memory as needed Many processes can run on a single machine Provide each process its own memory space Prevents a process from accessing the memory of other processes running on the same machine Allows the sum of memory spaces of all process to be larger than physical memory Basic terminology Virtual Address Space: address space used by the programmer Physical Address: actual physical memory address space
Background image of page 2
Computer Architecture 2010 – VM 3 Virtual Memory: Basic Idea Divide memory (virtual and physical) into fixed size blocks Pages in Virtual space, Frames in Physical space Page size = Frame size
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer Architecture 2010 – VM 4 Main memory can act as a cache for the secondary storage (disk) Advantages: illusion of having more physical memory program relocation protection Virtual Memory Virtual Addresses Physical Addresses Address Translation Disk Addresses
Background image of page 4
Computer Architecture 2010 – VM 5 Virtual to Physical Address translation 63 Page offset 0 11 Virtual Page Number Page offset 11 0 Physical Frame Number 31 Virtual Address Physical Address V D Frame number 1 Page table base reg 0 Valid bit Dirty bit 12 AC Access Control 12 Page size: 2 12 byte =4K byte
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer Architecture 2010 – VM 6 Page Tables Valid 1 Physical Memory Disk Page Table Physical Page Or Disk Address 1 1 1 1 1 1 1 1 0 0 0 Virtual page number
Background image of page 6
Computer Architecture 2010 – VM 7 If V = 1 then page is in main memory at frame address stored in table Fetch data else ( page fault ) need to fetch page from disk causes a trap, usually accompanied by a context switch: current process suspended while page is fetched from disk Access Control (R = Read-only, R/W = read/write, X = execute only) If kind of access not compatible with specified access rights then protection_violation_fault causes trap to hardware, or software fault handler Missing item fetched from secondary memory only on the occurrence of a fault demand load policy Address Mapping Algorithm
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer Architecture 2010 – VM 8 Page Replacement Algorithm Not Recently Used (NRU) Associated with each page is a reference flag such that ref flag = 1 if the page has been referenced in recent past If replacement is needed, choose any page frame such that its reference bit is 0. This is a page that has not been referenced in the recent past Clock implementation of NRU: While (PT[LRP].NRU) { PT[LRP].NRU LRP++ (mod table size) } 1 0 1 0 0 0 page table entry Ref bit 1 0 Possible optimization: search for a page that is both not recently referenced AND not dirty
Background image of page 8
Computer Architecture 2010 – VM 9 Page Faults Page faults:
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/14/2011 for the course CS 234267 taught by Professor Rapaport during the Spring '07 term at Technion.

Page1 / 58

L9-10_VM_2010 - Computer Architecture Virtual Memory Dr....

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online