Project Presentation By: Dean Morrison 12/6/2006 Dynamically Adaptive Prepaging for Effective Virtual Memory Management.

Slides:



Advertisements
Similar presentations
4.4 Page replacement algorithms
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.
Page Replacement Algorithms
Paging: Design Issues. Readings r Silbershatz et al: ,
Chapter 4 Memory Management Page Replacement 补充:什么叫页面抖动?
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 36 Virtual Memory Read.
Chapter 101 Cleaning Policy When should a modified page be written out to disk?  Demand cleaning write page out only when its frame has been selected.
Virtual Memory Introduction to Operating Systems: Module 9.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Segmentation and Paging Considerations
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
Day 23 Virtual Memory. Operating system’s role in VM Hardware-support Use VM or not Use paging or segmentation or both Software domain Algorithms for.
Memory Management Design & Implementation Segmentation Chapter 4.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Virtual Memory Chapter 8.
Memory Management (II)
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Lecture 11: Memory Management
Memory Problems Prof. Sin-Min Lee Department of Mathematics and Computer Sciences.
1 Virtual Memory vs. Physical Memory So far, all of a job’s virtual address space must be in physical memory However, many parts of programs are never.
Memory Management 2010.
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.
1 Lecture 9: Virtual Memory Operating System I Spring 2007.
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
CSI 400/500 Operating Systems Spring 2009 Lecture #9 – Paging and Segmentation in Virtual Memory Monday, March 2 nd and Wednesday, March 4 th, 2009.
Virtual Memory:Part 2 Kashyap Sheth Kishore Putta Bijal Shah Kshama Desai.
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Virtual Memory.
Chapter 3 Memory Management: Virtual Memory
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
Page 1 2P13 Week 5. Page 2 Page 3 Page 4 Page 5.
Subject: Operating System.
VIRTUAL MEMORY By Thi Nguyen. Motivation  In early time, the main memory was not large enough to store and execute complex program as higher level languages.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally VIRTUALMEMORY.
A Single-Pass Cache Simulation Methodology for Two-level Unified Caches + Also affiliated with NSF Center for High-Performance Reconfigurable Computing.
Copyright ©: Lawrence Angrave, Vikram Adve, Caccamo 1 Virtual Memory.
Abdullah Aldahami ( ) March 23, Introduction 2. Background 3. Simulation Techniques a.Experimental Settings b.Model Description c.Methodology.
Virtual Memory. Background Virtual memory is a technique that allows execution of processes that may not be completely in the physical memory. Virtual.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Demand Paging.
1 Virtual Memory. Cache memory: provides illusion of very high speed Virtual memory: provides illusion of very large size Main memory: reasonable cost,
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
1 Lecture 8: Virtual Memory Operating System Fall 2006.
Understanding Operating Systems Fifth Edition Chapter 3 Memory Management: Virtual Memory.
NETW3005 Virtual Memory. Reading For this lecture, you should have read Chapter 9 (Sections 1-7). NETW3005 (Operating Systems) Lecture 08 - Virtual Memory2.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
1 Page Replacement Algorithms. 2 Virtual Memory Management Fundamental issues : A Recap Key concept: Demand paging  Load pages into memory only when.
Virtual Memory. 2 Last Week Memory Management Increase degree of multiprogramming –Entire process needs to fit into memory Dynamic Linking and Loading.
Virtual Memory By CS147 Maheshpriya Venkata. Agenda Review Cache Memory Virtual Memory Paging Segmentation Configuration Of Virtual Memory Cache Memory.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Background Virtual memory – separation of user logical memory.
Virtual Memory Chapter 8.
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Virtual memory.
Understanding Operating Systems Seventh Edition
ITEC 202 Operating Systems
Virtual Memory Chapter 8.
Lecture 10: Virtual Memory
Chapter 9: Virtual-Memory Management
Chapter 9: Virtual Memory
Virtual Memory: Working Sets
Lecture 9: Caching and Demand-Paged Virtual Memory
COMP755 Advanced Operating Systems
Presentation transcript:

Project Presentation By: Dean Morrison 12/6/2006 Dynamically Adaptive Prepaging for Effective Virtual Memory Management

4/13/05 2 Introduction

3 Paging & Virtual Memory Management  During the execution of programs, different pages are referenced in memory  These pages may or may not be located in physical memory, but instead only on disk storage  Paging (Demand Paging) is a process used to manage which pages to store in physical memory IntroductionDesignSimulationEvaluationConclusion

4/13/05 4 Demand Paging  Simple method for implementing virtual memory  Pages are copied into physical memory only after being referenced  Advantages:  Avoids loading pages that are never accessed (saves memory for other processes increased degree of multiprogramming)  Disadvantages:  Fails to exploit predictability of page references through prepaging IntroductionDesignSimulationEvaluationConclusion

4/13/05 5 Demand Prepaging  A more complex extension to the concept of Demand Paging  Introduced as an attempt to reduce page fault rate  Upon a page fault, additional pages are fetched along with the demanded page  Takes advantage of high disk bandwidths while avoiding high disk latencies DesignEvaluationConclusionSimulationIntroduction

4/13/05 6 Prepage Parameters  Demand prepaging is governed by several main parameters:  Prepaged Allocation: The number of main memory page frames to be allocated to prepaged pages  Prepage Degree: The number of prepaged pages to fetch along with the demanded page  Prediction Method: The method used to predict which pages to prepage  It is intuitive that there exists an optimum configuration of these parameters such that page faults are minimized IntroductionDesignEvaluationConclusionSimulation

4/13/05 7 Dynamically Adaptive Prepaging (DAP)  An extension of demand prepaging  Prepage parameters are dynamically adapted to modulating trends or phases in the page reference stream and resource state IntroductionDesignEvaluationConclusionSimulation

4/13/05 8 Design

9 DAP Design EvaluationConclusionSimulationIntroductionDesign  In order to dynamically adapt prepage parameters, several data structures are necessary:  Used Page Queue (Resident and Non-Resident)  Prepaged Page Queue (Resident and Non-Resident)  Hit Histograms corresponding to queue positions  Other specialty queues (to be discussed later)  All page queues will be maintained in LRU order for page replacement purposes

4/13/05 10 DAP Page Queues  O/S-managed queues used to order used and prepaged pages  Both resident and non-resident pages are maintained in the queues EvaluationConclusionSimulationIntroductionDesign

4/13/05 11 Prepaged Allocation  Definition: The number of main memory page frames to be allocated for prepaged pages – pages that are fetched along with the page whose reference caused a page fault.  Too low reduces effectiveness of prepaging  Too high reduces allocation for used pages, may actually increase page faults  Other Parameters:  Target Allocation: Maximum number of main memory page frames to be allocated to prepaged pages  Consumed Allocation: Number of main memory page frames currently consumed by prepaged pages  How to determine optimum prepaged allocation? EvaluationConclusionSimulationIntroductionDesign

4/13/05 12 Dynamic Prepaged Allocation  Use a cost-benefit analysis to determine optimum prepaged allocation 1. Use Hit Histograms to calculate cost and benefit of all possible target allocations 2. The net reduction in misses is then the difference between benefit and cost 3. Choose target allocation with highest net reduction in misses  Example:  m-page memory  Target Allocation t, 0 ≤ t < m EvaluationConclusionSimulationIntroductionDesign

4/13/05 13 Dynamic Prepaged Allocation  Example:  m-page memory  Target Allocation t, 0 ≤ t < m EvaluationConclusionSimulationIntroductionDesign

4/13/05 14 Dynamic Prepaged Allocation  To adapt to changes in reference stream phases and trends, histogram entries are decayed periodically  Decay value (0 < decay < 1) and decay period are pre-defined static parameters which can be adjusted based on empirical data EvaluationConclusionSimulationIntroductionDesign

4/13/05 15 Prepage Degree  Definition: The number of additional pages to fetch along with the page whose reference caused a page fault.  Too low reduces effectiveness of prepage page prediction  Too high fills prepage page queue quickly, potentially evicting prepaged pages that have yet to be referenced  How to determine optimum prepage degree? EvaluationConclusionSimulationIntroductionDesign

4/13/05 16 Dynamic Prepage Degree (d )  Use an additional queue, the Degree Queue  Contains the d th, (d+1) th, and (d+2) th prepage page predictions  Note: DAP system does not actually fetch the (d+1) th, and (d+2) th prepage pages into physical memory  The page numbers are stored in the Degree Queue in order to determine if increasing the degree would be advantageous  Corresponding Hit Histogram EvaluationConclusionSimulationIntroductionDesign

4/13/05 17 Dynamic Prepage Degree (d )  Determining prepage degree: 1. If the (d+2) th prepage page prediction was referenced after the last degree update, the degree is incremented by 2 2. Else, if the (d+1) th prepage page prediction was referenced after the last degree update, the degree is incremented by 1 3. Else, if the (d) th prepage page prediction was referenced after the last degree update, the degree is unchanged 4. Else, the degree is reduced by 1  A pre-defined static minimum and maximum prepage degree are parameters of the DAP system  Eliminate the potential for runaway adaptation EvaluationConclusionSimulationIntroductionDesign

4/13/05 18 Dynamic Prepage Degree (d )  Prepage degree is (by default) updated after every page fault  Can be modified to less frequent updates EvaluationConclusionSimulationIntroductionDesign

4/13/05 19 Prepage Prediction  Definition: The method used to predict pages that are most likely to be referenced in the near future and should therefore be candidates for prepaging. EvaluationConclusionSimulationIntroductionDesign

4/13/05 20 Prepage Prediction  Different Methods:  Address Local Prediction:  Address Local Prediction: Pages nearby in the address space to the one being demanded would be likely to be used soon   Ex: Degree d, Referenced Page Number n Predictions: n + 1, n - 1, n + 2, n - 2,...  Recency Local Prediction:  Recency Local Prediction: Pages nearby in an LRU ordering to the one being demanded would likely be used soon   Ex: Degree d, Reference to page found at LRU queue position p Predictions: Pages found in LRU queue positions p - 1, p + 1, p - 2, p + 2,...   Stride Prediction: Pages located at a constant stride in the address space from the one in demand would likely be used soon   Ex: Degree d, Referenced Page Number n, MRU Page Queue Entry p stride s = n - p Predictions: n + s, n + 2s, n + 3s,..., n + ds EvaluationConclusionSimulationIntroductionDesign

4/13/05 21 Dynamic Prepage Prediction Method  Determining prepage prediction method:  Use the prediction method which has been most effective since last page fault  Necessary data structures:  Prediction Queue for each prediction method EvaluationConclusionSimulationIntroductionDesign

4/13/05 22 Dynamic Prepage Prediction EvaluationConclusionSimulationIntroductionDesign

4/13/05 23 Simulation

4/13/05 24Simulation EvaluationConclusion  A simulator was developed to design, test, and evaluate DAP concepts  DAPsim is a trace-driven simulator developed in C++, with the following capabilities:  Maintains main memory page queues  Handles page references  Models dynamic prepage allocation, degree, and prediction method  Accumulates performance statistics (page misses, miss rate, reference trace characteristics, hit/miss trace, disk transfers)  2463 lines of original code! IntroductionDesignSimulation

4/13/05 25 Simulating Page Queues  Page Reference Handling: 1. Check if referenced page resides in Used Page Queue  If so, increment histogram at queue position and move page to MRU queue position 2. If not, check if referenced page resides in Prepaged Page Queue  If so, increment histogram at queue position and evict page to MRU queue position of Used Page Queue 3. If not, a page fault has occurred … EvaluationConclusionIntroductionDesignSimulation

4/13/05 26 Simulating Page Queues EvaluationConclusionIntroductionDesignSimulation  Page Fault Handling:  The demanded page is “fetched” from disk into main memory and placed in the MRU entry of the Used Page Queue  Prepage Degree and Prediction Method are used to generate a prepage page list  Prepaged pages that already reside in the Used Page Queue are removed from the list  Prepaged pages are placed into the MRU positions of the Prepaged Page Queue

4/13/05 27 DAPsim Flow EvaluationConclusionIntroductionDesignSimulation

4/13/05 28 Simulation Methodology EvaluationConclusionIntroductionDesignSimulation  Simulations were performed on several uni- programmed memory reference traces over a range of main memory sizes  Different system configurations were simulated:  Static Prepage Parameter Mode: All prepage parameters are static  Dynamic Prepaged Allocation Mode: Prepage Allocation is the only prepage parameter that is dynamically adapted  Dynamic Degree Mode: Prepage Degree is the only prepage parameter that is dynamically adapted  Dynamic Prediction Method Mode: Prepage Prediction Method is the only prepage parameter that is dynamically adapted  DAP Mode: All prepage parameters are dynamically adapted

4/13/05 29 Simulation Methodology EvaluationConclusionIntroductionDesignSimulation  Simulations were performed on several uni- programmed memory reference traces over a range of main memory sizes  Different system configurations were simulated:

4/13/05 30 Memory Reference Traces EvaluationConclusionIntroductionDesignSimulation  Simulations were performed using the following memory reference traces:

4/13/05 31 Evaluation

4/13/05 32 DAP Miss Rate Reduction ConclusionSimulationDesignIntroductionEvaluation  Avg miss rate reduction: 30%  Relatively constant over multiple memory sizes  Best reduction in micro/synthetic benchmarks  Avg miss rate reduction in real benchmarks: 1.42 to 3.92% (depending on which benchmarks are included)

4/13/05 33 Dynamic Degree Miss Rate Reduction ConclusionSimulationDesignIntroductionEvaluation  Avg miss rate reduction: 36%  Best reduction in micro/synthetic benchmarks  Avg miss rate reduction in real benchmarks: 8%  Provided better miss rate reduction than DAP  Possibly because of the limited range of memory references in uni-program reference traces

4/13/05 34 DAP Page Transfer Increase  Page Transfer Increase: % increase in total number of page transfers over entire simulation of the trace  Avg page transfer increase: 18%  Highest page transfer increase in micro/synthetic benchmarks  Avg page transfer increase in real benchmarks: 12% ConclusionSimulationDesignIntroductionEvaluation

4/13/05 35 DAP Page Transfers/Fault Increase  Avg increase in page transfers per page fault: 4.27 pages/fault  Highest increase in micro/synthetic benchmarks  Avg increase in page transfers per page fault in real benchmarks: 0.94 pages/fault ConclusionSimulationDesignIntroductionEvaluation

4/13/05 36 Conclusion

4/13/05 37 ConclusionEvaluation DAP Performance Discussion  Page Fault Reduction: DAP reduces page fault rates for uni-programmed memory reference traces  How will it perform for multi-programmed? VMs?  Empirical data shows that DAP performs better as range of memory references increases  This would likely be the case in multi-programmed and VM scenarios  Page Transfer Increase: DAP often leads to an increase in page transfers  Mostly in increased page transfers / page fault  Thus effecting disk bandwidth, not latency SimulationDesignIntroduction

4/13/05 38 ConclusionEvaluation Future Work  Simulation of multi-programmed and VM reference traces  New prepage prediction methods  More efficient implementations SimulationDesignIntroduction

4/13/05 39 ConclusionEvaluationQuestions???? SimulationDesignIntroduction