Virtual Memory Review CSE 121 Spring 2003 Keith Marzullo.

Slides:



Advertisements
Similar presentations
Virtual Memory 3 Fred Kuhns
Advertisements

Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
Virtual Memory II Chapter 8.
Virtual Memory: Page Replacement
Scribe for 7 th April 2014 Page Replacement Algorithms Payal Priyadarshini 11CS30023.
Chapter 8 Virtual Memory
Chapter 4 Memory Management Page Replacement 补充:什么叫页面抖动?
Chapter 9: Virtual Memory
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
16.317: Microprocessor System Design I
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
1 Virtual Memory Management B.Ramamurthy. 2 Demand Paging Main memory LAS 0 LAS 1 LAS 2 (Physical Address Space -PAS) LAS - Logical Address.
Module 9: Virtual Memory
Module 10: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing.
Virtual Memory Background Demand Paging Performance of Demand Paging
Virtual Memory Introduction to Operating Systems: Module 9.
Gordon College Stephen Brinton
Virtual Memory Chapter 8.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Virtual Memory Chapter 8.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems Revisiting Virtual Memory.
Virtual Memory CSCI 444/544 Operating Systems Fall 2008.
Virtual Memory Management B.Ramamurthy. Paging (2) The relation between virtual addresses and physical memory addres- ses given by page table.
1 Virtual Memory Management B.Ramamurthy Chapter 10.
OS Spring’04 Virtual Memory: Page Replacement Operating Systems Spring 2004.
Answers to the VM Problems Spring First question A computer has 32 bit addresses and a virtual memory with a page size of 8 kilobytes.  How many.
03/29/2004CSCI 315 Operating Systems Design1 Page Replacement Algorithms (Virtual Memory)
Operating Systems ECE344 Ding Yuan Page Replacement Lecture 9: Page Replacement.
Chapter VIII Virtual Memory Review Questions Jehan-François Pâris
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Virtual Memory.
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
1 Memory Management 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement algorithms.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Page Replacement Allocation of.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
CPS110: Page replacement Landon Cox. Replacement  Think of physical memory as a cache  What happens on a cache miss?  Page fault  Must decide what.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 9: Virtual-Memory Management.
Lecture Topics: 11/24 Sharing Pages Demand Paging (and alternative) Page Replacement –optimal algorithm –implementable algorithms.
CSC 360, Instructor: Kui Wu Memory Management II: Virtual Memory.
CS307 Operating Systems Virtual Memory Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2012.
Silberschatz, Galvin and Gagne  Operating System Concepts Virtual Memory Virtual memory – separation of user logical memory from physical memory.
CSE 153 Design of Operating Systems Winter 2015 Lecture 12: Page Replacement.
1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples (not covered.
1 Memory Management Chapter Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement.
10.1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples.
Operating Systems ECE344 Ding Yuan Page Replacement Lecture 9: Page Replacement.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Background Virtual memory – separation of user logical memory.
Virtual Memory Operating Systems 1 Computer Science Dept Va Tech August 2007 © McQuain Page Buffering LRU and the Clock Algorithm are generally.
CS 333 Introduction to Operating Systems Class 14 – Page Replacement
Virtual Memory What if program is bigger than available memory?
Virtual Memory Chapter 8.
OPERATING SYSTEM CONCEPTS AND PRACTISE
ITEC 202 Operating Systems
Instructor: Junfeng Yang
Chapter 8 Virtual Memory
CSE 120 Principles of Operating
Module 9: Virtual Memory
EECE.4810/EECE.5730 Operating Systems
Chapter 9: Virtual-Memory Management
Lecture 39 Syed Mansoor Sarwar
5: Virtual Memory Background Demand Paging
Computer Architecture
Operating Systems CMPSC 473
Lecture 9: Caching and Demand-Paged Virtual Memory
Module 9: Virtual Memory
Chapter 8 & 9 Main Memory and Virtual Memory
CSE 542: Operating Systems
Presentation transcript:

Virtual Memory Review CSE 121 Spring 2003 Keith Marzullo

CSE 121 Spring 2003Review of Concurrency2 Virtual Memory API Most utilization of memory is automatic °Program and data allocation. °Stack management. Some are not °malloc or new routines. °memory mapped files. °shared memory segments.

CSE 121 Spring 2003Review of Concurrency3 Virtual memory NMAP physical address virtual address

CSE 121 Spring 2003Review of Concurrency4 Segmentation segment offsetbase addresslengthaccessbase addresslengthaccessbase addresslengthaccessbase addresslengthaccessbase addresslengthaccessbase addresslengthaccess  physical address if (offset > length) segment fault

CSE 121 Spring 2003Review of Concurrency5 Paging offset  physical address if (!valid) page fault page page framerefaccess dirty page framerefaccess dirty page framerefaccess dirty page framerefaccess dirty valid

CSE 121 Spring 2003Review of Concurrency6 IA-32 architecture (simplified) Linear Address Space Linear Address DirTableOffset Code Data Stack Task-State Segment (TSS) Code, Data or Stack Segment Global Descriptor Table (GDT) Segment Sel. TSS Seg. Sel. CR3 Physical Address Linear Address Segment Selector Linear Addr. Page DirectoryPage TablePage Page Dir. Entry Page Tbl. Entry Physical Addr.

CSE 121 Spring 2003Review of Concurrency7 SUN UltraSPARC III (simplified)

CSE 121 Spring 2003Review of Concurrency8 Demand Paging When a page fault occurs: °Find a free page frame. If none, then choose a page to evict. °Read page from backing store into this frame. °Assign page to this page frame. °Resume process. … which page should be evicted?

CSE 121 Spring 2003Review of Concurrency9 Page replacement policies FIFO Easy to implement, but poor performance. Optimal: evict page that will be next referenced farthest in the future. Need ability to predict the future. LRU: using the past to predict the future. Too high overhead. Clock: LRU approximation.

CSE 121 Spring 2003Review of Concurrency10 CLOCK Advance CLOCK hand Test and clear use-bit Schedule page for cleaning Replace page Use-bitDirty-bit set clear

CSE 121 Spring 2003Review of Concurrency11 Miss ratio for different policies

CSE 121 Spring 2003Review of Concurrency12 FIFO miss ratio (detail)

CSE 121 Spring 2003Review of Concurrency13 Working set The only reason that virtual memory works at all in practice is because of the amount of locality there is in address references. °The page fault penalty is  10 5 °If page faulted on only 1 out of ten references, then the program would run 10,000 times slower.

CSE 121 Spring 2003Review of Concurrency14 Working set, II Define the working set of a process's reference string  at time t for a window  to be the pages  t  t ...  t .  =  1; 2; 3; 4; 5; 4; 5; 4; 5; 4; 5 

CSE 121 Spring 2003Review of Concurrency15 Working set, III

CSE 121 Spring 2003Review of Concurrency16 Working set policy, I A process can run only if its working set is resident. Example: °UNIX can (temporarily) remove a process from the ready set if the page fault rate is too high. Choose a process that has been sleeping a long time. If none, then choose the longest resident of the four largest processes.

CSE 121 Spring 2003Review of Concurrency17 Working set policy, II One can modify CLOCK to approximate a working set policy. °Let PT be the current process time. °Each frame f is examined as usual. If the use bit set, then LR[f] = PT. If the use bit isn't set, then f is replaceable if PT  LR[f] > .