Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Project Presentation By: Dean Morrison 12/6/2006 Dynamically Adaptive Prepaging for Effective Virtual Memory Management."— Presentation transcript:

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

2 4/13/05 2 Introduction

3 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 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

5 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

6 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

7 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

8 4/13/05 8 Design

9 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

10 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

11 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

12 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

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

14 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

15 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

16 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

17 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

18 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

19 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

20 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

21 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

22 4/13/05 22 Dynamic Prepage Prediction EvaluationConclusionSimulationIntroductionDesign

23 4/13/05 23 Simulation

24 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

25 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

26 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

27 4/13/05 27 DAPsim Flow EvaluationConclusionIntroductionDesignSimulation

28 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

29 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:

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

31 4/13/05 31 Evaluation

32 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)

33 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

34 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

35 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

36 4/13/05 36 Conclusion

37 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

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

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


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

Similar presentations


Ads by Google