09_virtual memory

09_virtual memory - Chapter 9 Virtual-Memory Management...

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

View Full Document Right Arrow Icon
Chapter 9: Virtual-Memory Management
Background image of page 1

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

View Full DocumentRight Arrow Icon
9.2 Modified by Bo Li ©2009 Operating System Concepts Chapter 9: Virtual-Memory Management Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Demand Segmentation Operating System Examples
Background image of page 2
9.3 Modified by Bo Li ©2009 Operating System Concepts Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical address space can therefore be much larger than physical address space. Allows address spaces to be shared by several processes. Allows for more efficient process creation. Virtual memory can be implemented via: Demand paging Demand segmentation
Background image of page 3

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

View Full DocumentRight Arrow Icon
9.4 Modified by Bo Li ©2009 Operating System Concepts Virtual Memory - Larger Than Physical Memory
Background image of page 4
9.5 Modified by Bo Li ©2009 Operating System Concepts Virtual-address Space
Background image of page 5

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

View Full DocumentRight Arrow Icon
9.6 Modified by Bo Li ©2009 Operating System Concepts Shared Library Using Virtual Memory
Background image of page 6
9.7 Modified by Bo Li ©2009 Operating System Concepts Demand Paging Bring a page into memory only when it is needed Less I/O needed Less memory needed Faster response Can accommodate more users (memory) Page is needed reference to it invalid reference abort not-in-memory Page fault occurs, and bring to memory With each page table entry a valid– invalid bit is associated (1 in-memory, 0 not-in- memory) Initially valid–invalid but is set to 0 on all entries
Background image of page 7

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

View Full DocumentRight Arrow Icon
9.8 Modified by Bo Li ©2009 Operating System Concepts Steps in Handling a Page Fault 1. Reference to a page, valid bit is “invalid” (not in memory) 2. Trap into OS 3. Check if page is on the secondary storage 4. Bring page into the memory (possibly need to replace a page if no space in memory) 5. Reset page table 6. Return to the instruction
Background image of page 8
9.9 Modified by Bo Li ©2009 Operating System Concepts What happens if there is no free frame? Page replacement – find some page in memory, but not really in use, swap it out Replacement algorithm performance – want an algorithm which will result in minimum number of page faults Same page may be brought into and out of memory several times
Background image of page 9

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

View Full DocumentRight Arrow Icon
9.10 Modified by Bo Li ©2009 Operating System Concepts Performance of Demand Paging Page Fault Rate 0 p 1.0 if p = 0 no page faults if p = 1, every reference is a fault Effective Access Time (EAT) EAT = (1 – p ) x memory access + p (page fault overhead + [swap page out ] + swap page in + restart overhead)
Background image of page 10
9.11 Modified by Bo Li ©2009 Operating System Concepts Demand Paging Example Memory access time = 1 microsecond 50% of the time the page that is being replaced has been modified and therefore needs to be swapped out Swap Page Time = 10 msec = 10,000 msec EAT = (1 – p) x 1 + p (10000 + 5000) = 1 + 15000P (in msec) Suppose page fault rate = 0.01, EAT is 151 times slower!
Background image of page 11

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

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

This note was uploaded on 09/24/2010 for the course COMP 252 taught by Professor Wong during the Fall '09 term at HKUST.

Page1 / 44

09_virtual memory - Chapter 9 Virtual-Memory Management...

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

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