Operating Systems. Memory: replacement policies
|
|
- Noreen Alexina Park
- 6 years ago
- Views:
Transcription
1 Operating Systems Memory: replacement policies
2 Last time caching speeds up data lookups if the data is likely to be re-requested again data structures for O(1)-lookup data source set-associative (hardware) hash tables (software) cache coherence with 1 cache: buffer writes back to memory slow with multiple caches: things get complicated today: replacement policy data user fast cache
3 THE PROBLEM input: a sequence of requests for objects the cache? GOAL minimize number of cache misses
4 clairvoyant LRU LFU FIFO BASIC ALGORITHMS
5 clairvoyant BASIC ALGORITHMS LRU LFU FIFO
6 clairvoyant BASIC ALGORITHMS LRU LFU FIFO
7 clairvoyant BASIC ALGORITHMS LRU LFU FIFO
8 clairvoyant BASIC ALGORITHMS LRU LFU FIFO
9 clairvoyant BASIC ALGORITHMS LRU LFU FIFO
10 clairvoyant BASIC ALGORITHMS LRU LFU FIFO
11 clairvoyant BASIC ALGORITHMS LRU LFU FIFO
12 clairvoyant BASIC ALGORITHMS LRU LFU FIFO
13 clairvoyant BASIC ALGORITHMS LRU LFU FIFO
14 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
15 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
16 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
17 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
18 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
19 BASIC ALGORITHMS LRU clairvoyant LFU FIFO cache hit!
20 BASIC ALGORITHMS LRU clairvoyant LFU FIFO cache hit!
21 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
22 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
23 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
24 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
25 BASIC ALGORITHMS LRU clairvoyant LFU FIFO
26 clairvoyant BASIC ALGORITHMS LRU LFU FIFO x frequency(x) = number of requests evict object with smallest frequency
27 Model of virtual memory p p p disk: slow memory slow input: request sequence p0, p1, p2, p3,., pn fast RAM cache of size k k much smaller than # of pages in disk
28 Model of virtual memory p p p goal minimize total cost of slow bringing pages from disk input: request sequence p0, p1, p2, p3,., pn fast RAM
29 Paging problem p p p input s = p0, p1, p2, p3, pn output slow for each pi, which p to evict from cache goal input: request sequence p0, p1, p2, p3,., pn fast RAM minimize # misses
30 LFD is optimal proposed by Belady LFD: longest forward distance synonyms: OPT, MIN, clairvoyant, Belady s optimal alg proof given in class
31 LFD proof of optimality let ALG be any paging algorithm, s input seq. Will construct a seq of algorithms: ALG = ALG0, ALG1, ALG2, ALGn = LFD st cost(alg0, s) >= cost(alg1, s) >= cost(alg2, s) >= cost(algn) = LFD, n = len(s) how? by induction: suppose ALGi is determined construct ALG(i+1) as follows: for the first i-1 requests, do the same eviction decisions as ALGi. On request i, ALGi evicts the page currently in its cache that will be request furthest into the future, call this page v. ALG(i) may or may not evict this same page. If it does, let ALG(i+1) = ALG(i) for the future too, so then done. Otherwise ALG(i) evicts page u!= v. So after processing i, both caches are the same, but ALG(i) has v and ALG(i+1) has u, where u is requested before v. On future requests, ALG(i+1) mirrors the same decisions as ALG(i) except if ALG(i) evicts v, then ALG(i+1) evicts u. Since u will be requested first, ALG(i) will incur a miss when u is requested, at which point both may or may not be identical (off by 1). If v is requested in the future, then the costs will be identical.
32 Belady s anomaly increasing the cache size may result in more misses hw: FIFO suffers from this phenomenon hw: LRU doesn t
33 Competitive analysis Which replacement policy is better? competitive ratio of ALG = max sequences s misses(alg, s) misses(opt, s) ALG is said to be k-competitive if its competitive ratio is k
34 LRU is k-competitive for any input sequence s: misses(lru, s) k misses(opt, s) Proof sketch: divide s into k-phases, where each phase consists of references to exactly k distinct pages then misses(lru, s) k and misses(opt, s) 1
35 FIFO is k-competitive for any input sequence s: misses(fifo, s) k misses(opt, s) Proof: homework
36 LFU is not competitive there exists a sequence of input sequences s1, s2, s3, misses(lfu, si) lim i!1 = 1 misses(opt, si) Proof: let si = p0 (x i+1), p1 (x i+1), p(k-1) (x i+1), [pk, p(k+1)] (x i) then misses(lfu, si) = k-1 + 2i and misses(opt, si) = k
37 LIFO is not competitive there exists a sequence of input sequences s1, s2, s3, misses(lifo, si) lim i!1 = 1 misses(opt, si) Proof: homework
38 A timeline of paging analysis Belady s paper shows that MIN is optimal competitive analysis, Sleator and Tarjan 1995: 1st analysis of paging with locality of reference, Borodin et al. using access graphs 1996: strongly competitiveness, Irani et al. 1999: LRU is better than FIFO 2000: markov paging, Karlin et al. 2007: relative worst order, Boyar et al over the years: alternative performance measures proposed various frameworks for locality of reference proposed 2009: relative dominance, Dorrigiv et al 2010: parameterized analysis, Dorrigiv et al 2012: access graph model under worst order analysis, Boyar et al 2013: access graph model under relative interval analysis, Boyar et al. 2015: competitiveness in terms of locality parameters, Albers et al.
39 LRU LFU FIFO STRENGTHS AND WEAKNESSES
40 good if popularity changes quickly unpopular objects stay too long LRU LFU FIFO STRENGTHS AND WEAKNESSES
41 good if popularity changes quickly unpopular objects stay too long LRU LFU FIFO good if popularity is static suffers from cache pollution over time STRENGTHS AND WEAKNESSES
42 good if popularity changes quickly unpopular objects stay too long good when fragmentation is an issue LRU LFU FIFO good if popularity is static suffers from cache pollution over time STRENGTHS AND WEAKNESSES
43 LRU FIXING IT admission control find a middle ground between LRU and LFU
44 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
45 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
46 Q ARC LRU-K priority = k-th most recent reference LRU common LRFU FIFO k LRU-LFU HYBRID EVICTION ALGORITHMS
47 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
48 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
49 Q ARC enter here LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
50 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
51 Q ARC evict LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
52 Q ARC evict LRU-K cache hit! LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
53 Q ARC LRU-K cache hit! LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
54 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
55 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
56 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
57 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
58 Q ARC aka Segmented LRU 80% 20% LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
59 Q ARC LRU-K S4LRU LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
60 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
61 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
62 Q ARC LRU-K second hit and more enter here LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
63 Q ARC dynamically adjust ghost ghost LRU-K second hit and more enter here LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
64 Q ARC LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
65 combined recency and frequency CRF(x) = P i t(x,i) Q ARC time since last i-th request to x LRU-K LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
66 combined recency and frequency CRF(x) = P i t(x,i) Q ARC time since last i-th request to x LRU-K 1 2 LFU LRU LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
67 combined recency and frequency CRF(x) = P i t(x,i) Q ARC time since last i-th request to x LRU-K 1 2 LFU in practice LRU LRFU LRU-LFU HYBRID EVICTION ALGORITHMS
68 Q ARC W-LFU geometric fading LRU-K LRFU HYBRID SOLUTIONS TEND TO DO WELL Evaluation of Caching Strategies Based on Access Statistics of Past Requests, Hasslinger, Ntougias, MMB & DFT 2014
69 LRU CACHING POLICIES LFU exact TOWARDS PRACTICALITY approximate UNDERSTANDING THE WORKLOAD
70 LRU handles bursts in popularity well the colder can push out the warmer LFU suffers from cache pollution optimal if popularity is static
71 2nd hit caching score-based LRU SIZE LRU handles bursts in popularity well the colder can push out the warmer LFU suffers from cache pollution optimal if popularity is static Q ARC LRU-K LRFU
72 x e f d t m z a... evict this guy first what a caching algorithm boils down to
73 x e f d t m z a... evict this guy first r v l o m r i a... priority e 2000 what a caching algorithm boils down to
74 x e f d t m z a... evict this guy first r v l o m r i a... priority e 2000 evict this guy what a caching algorithm boils down to
75 caching algorithm template r v l o m r i a e 2000 handle-request(object o): if o is in cache: update priority(o) (for all p in cache: update priority(p)) else: while there is not enough room in cache for o: find and evict object in cache with smallest priority bring o in cache compute priority(o) (for all p in cache: update priority(p))
76 caching algorithm template r v l o m r i a e 2000 handle-request(object o): if o is in cache: update priority(o) (for all p in cache: update priority(p)) else: while there is not enough room in cache for o: find and evict object in cache with smallest priority bring o in cache compute priority(o) (for all p in cache: update priority(p))
77 caching algorithm template r v l o m r i a e 2000 handle-request(object o): if o is in cache: update priority(o) (for all p in cache: update priority(p)) else: while there is not enough room in cache for o: find and evict object in cache with smallest priority bring o in cache compute priority(o) (for all p in cache: update priority(p))
78 caching algorithm template r v l o m r i a... LRU e 2000 handle-request(object o): if o is in cache: update priority(o) (for all p in cache: update priority(p)) O(1) else: while there is not enough room in cache for o: find and evict object in cache with smallest priority O(1) bring o in cache compute priority(o) (for all p in cache: update priority(p)) O(1)
79 clock: an approximation of LRU a 0 g 0 b 0 f 0 c 0 e 0 d 0 e d a e b h
80 clock: an approximation of LRU a 0 g 0 b 0 f 0 c 0 e 1 d 0 e d a e b h
81 clock: an approximation of LRU a 0 g 0 b 0 f 0 c 0 e 1 d 1 e d a e b h
82 clock: an approximation of LRU a 1 g 0 b 0 f 0 c 0 e 1 d 1 e d a e b h
83 clock: an approximation of LRU a 1 g 0 b 0 f 0 c 0 e 1 d 1 e d a e b h
84 clock: an approximation of LRU a 1 g 0 b 1 f 0 c 0 e 1 d 1 e d a e b h
85 clock: an approximation of LRU a 1 g 0 b 1 f 0 c 0 e 1 d 1 e d a e b h
86 clock: an approximation of LRU a 0 g 0 b 1 f 0 c 0 e 1 d 1 e d a e b h
87 clock: an approximation of LRU a 0 g 0 b 0 f 0 c 0 e 1 d 1 e d a e b h
88 clock: an approximation of LRU a 0 g 0 b 0 f 0 ch 0 e 1 d 1 e d a e b h
89 clock: an approximation of LRU a 0 g 0 b 0 f 0 ch 0 e 1 d 1 e d a e b h
90 handle-request(object o): if o is in cache: update priority(o) else: while there is not enough room in cache for o: find and evict object in cache with smallest priority bring o in cache compute priority(o)
91 LRU handle-request(object o): if o is in cache: update priority(o) O(1) else: while there is not enough room in cache for o: find and evict object in cache with smallest priority O(1) bring o in cache compute priority(o) O(1)
92 LRU clock handle-request(object o): if o is in cache: update priority(o) O(1) move to front bit =1 else: while there is not enough room in cache for o: find and evict object in cache with smallest priority O(1) remove from tail move hand bring o in cache set bits to 0 compute priority(o) O(1) place in front bit = 0
93 handle-request(object o): if o is in cache: update priority(o) else: while there is not enough room in cache for o: find and evict object in cache with smallest priority bring o in cache compute priority(o) what about in general
94 using a priority queue (heap) handle-request(object o): if o is in cache: update priority(o) O(log n) else: while there is not enough room in cache for o: find and evict object in cache with smallest priority O(log n) bring o in cache compute priority(o) O(log n) n = nb objects in cache
95 exact algorithm approximate algorithm LRU clock
96 exact algorithm approximate algorithm LRU clock your favorite algorithm pre-sorting as much as possible coarse graining/bucketing/rounding priorities good enough algorithm
97 The popularity of objects follows Zipf s law. # objects heavy tail of unpopular objects popular popularity UNDERSTANDING THE WORKLOAD
98 The object size follows a log-normal distribution # objects # objects size 1K 2K 3K 4K 5K 6K size UNDERSTANDING THE WORKLOAD
99 FIGURES OF MERIT origin server edge server client reduce load maximize byte hit ratio sum of sizes of objects that were request hits reduce perceived delay maximize hit ratio # request hits
100 opularity popularity size size prefer to keep small objects large objects prefer to keep small objects large objects better hit ratio worse worse hit ratio better same byte hit ratio same worse byte hit ratio better fferent popularity-size correlations will yield different performances
101 Recap LFD, LRU, FIFO, LFU provable results: LFD is optimal LRU and FIFO are k-competitive, LFU is not practice: LRU-LFU hybrids are preferred because workloads tend to exhibit locality of reference practice: clock approximates LRU with low overhead practice: best algorithm will depend on the workload
102 CACHE REPLACEMENT CONSIDERED LESS IMPORTANT large caches: decreasing storage cost reduction of cacheable traffic and rate of change (changes to objects over time reduce value of having a large cache to store them longer) plenty of good enough algorithms
103 Extra
104 Locality of reference An input sequence of references exhibits locality of reference if a page that is referenced is likely to be referenced again in the near future.
105 Modeling locality of reference Characteristic vector of an input sequence s C =(c 0,...,c p 1 ) p: number of distinct pages referenced c_i: number of distance-i requests distance-i request: a request to a page such that the number of distinct pages requested since the last time this page was requested is i Ref: Quantifying Competitiveness in Paging with Locality of Reference, Albers, Frascaria, 2015
106 LRU beats FIFO in the presence of locality of reference Characteristic vector of an input sequence s C =(c 0,...,c p 1 ) What does the characteristic vector of a sequence with high locality of reference look like? Ref: Quantifying Competitiveness in Paging with Locality of Reference, Albers, Frascaria, 2015
Course Outline. Processes CPU Scheduling Synchronization & Deadlock Memory Management File Systems & I/O Distributed Systems
Course Outline Processes CPU Scheduling Synchronization & Deadlock Memory Management File Systems & I/O Distributed Systems 1 Today: Memory Management Terminology Uniprogramming Multiprogramming Contiguous
More informationECE7995 Caching and Prefetching Techniques in Computer Systems. Lecture 8: Buffer Cache in Main Memory (I)
ECE7995 Caching and Prefetching Techniques in Computer Systems Lecture 8: Buffer Cache in Main Memory (I) 1 Review: The Memory Hierarchy Take advantage of the principle of locality to present the user
More informationLocality of Reference
Locality of Reference 1 In view of the previous discussion of secondary storage, it makes sense to design programs so that data is read from and written to disk in relatively large chunks but there is
More informationLecture 14: Cache & Virtual Memory
CS 422/522 Design & Implementation of Operating Systems Lecture 14: Cache & Virtual Memory Zhong Shao Dept. of Computer Science Yale University Acknowledgement: some slides are taken from previous versions
More informationCaching and Demand-Paged Virtual Memory
Caching and Demand-Paged Virtual Memory Definitions Cache Copy of data that is faster to access than the original Hit: if cache has copy Miss: if cache does not have copy Cache block Unit of cache storage
More informationLeast Recently Frequently Used Caching Algorithm with Filtering Policies
VLSI Project Least Recently Frequently Used Caching Algorithm with Filtering Policies Alexander Zlotnik Marcel Apfelbaum Supervised by: Michael Behar, Winter 2005/2006 VLSI Project Winter 2005/2006 1 Introduction
More informationPaging algorithms. CS 241 February 10, Copyright : University of Illinois CS 241 Staff 1
Paging algorithms CS 241 February 10, 2012 Copyright : University of Illinois CS 241 Staff 1 Announcements MP2 due Tuesday Fabulous Prizes Wednesday! 2 Paging On heavily-loaded systems, memory can fill
More informationOperating Systems. Operating Systems Sina Meraji U of T
Operating Systems Operating Systems Sina Meraji U of T Recap Last time we looked at memory management techniques Fixed partitioning Dynamic partitioning Paging Example Address Translation Suppose addresses
More informationVirtual Memory - II. Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - XVI. University at Buffalo.
CSE 421/521 - Operating Systems Fall 2012 Lecture - XVI Virtual Memory - II Tevfik Koşar University at Buffalo October 25 th, 2012 1 Roadmap Virtual Memory Page Replacement Algorithms Optimal Algorithm
More informationECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management
ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Memory Management 1 Hardware background The role of primary memory Program
More informationVirtual Memory. CSCI 315 Operating Systems Design Department of Computer Science
Virtual Memory CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those from an earlier edition of the course text Operating
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 33 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ How does the virtual
More informationDemand- Paged Virtual Memory
Demand- Paged Virtual Memory Main Points Can we provide the illusion of near infinite memory in limited physical memory? Demand- paged virtual memory Memory- mapped files How do we choose which page to
More informationBasic Page Replacement
Basic Page Replacement 1. Find the location of the desired page on disk 2. Find a free frame: - If there is a free frame, use it - If there is no free frame, use a page replacement algorithm to select
More informationVirtual Memory Outline
Virtual Memory Outline Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations Operating-System Examples
More informationLast Class. Demand Paged Virtual Memory. Today: Demand Paged Virtual Memory. Demand Paged Virtual Memory
Last Class Segmentation User view of programs Each program consists of a number of segments Segmented Paging: combine the best features of paging and segmentation Today: Demand Paged Virtual Memory Up
More informationPage Replacement. 3/9/07 CSE 30341: Operating Systems Principles
Page Replacement page 1 Page Replacement Algorithms Want lowest page-fault rate Evaluate algorithm by running it on a particular string of memory references (reference string) and computing the number
More informationOutline. 1 Paging. 2 Eviction policies. 3 Thrashing 1 / 28
Outline 1 Paging 2 Eviction policies 3 Thrashing 1 / 28 Paging Use disk to simulate larger virtual than physical mem 2 / 28 Working set model # of accesses virtual address Disk much, much slower than memory
More informationCS 5523 Operating Systems: Memory Management (SGG-8)
CS 5523 Operating Systems: Memory Management (SGG-8) Instructor: Dr Tongping Liu Thank Dr Dakai Zhu, Dr Palden Lama, and Dr Tim Richards (UMASS) for providing their slides Outline Simple memory management:
More informationCIS Operating Systems Memory Management Page Replacement. Professor Qiang Zeng Spring 2018
CIS 3207 - Operating Systems Memory Management Page Replacement Professor Qiang Zeng Spring 2018 Previous class What is Demand Paging? Page frames are not allocated until pages are really accessed. Example:
More informationReminder: Mechanics of address translation. Paged virtual memory. Reminder: Page Table Entries (PTEs) Demand paging. Page faults
CSE 451: Operating Systems Autumn 2012 Module 12 Virtual Memory, Page Faults, Demand Paging, and Page Replacement Reminder: Mechanics of address translation virtual address virtual # offset table frame
More informationPage Replacement Algorithms
Page Replacement Algorithms MIN, OPT (optimal) RANDOM evict random page FIFO (first-in, first-out) give every page equal residency LRU (least-recently used) MRU (most-recently used) 1 9.1 Silberschatz,
More informationVirtual Memory. Virtual Memory. Demand Paging. valid-invalid bit. Virtual Memory Larger than Physical Memory
Virtual Memory Virtual Memory CSCI Operating Systems Design Department of Computer Science Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in
More informationOperating System Concepts
Chapter 9: Virtual-Memory Management 9.1 Silberschatz, Galvin and Gagne 2005 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped
More informationVirtual Memory COMPSCI 386
Virtual Memory COMPSCI 386 Motivation An instruction to be executed must be in physical memory, but there may not be enough space for all ready processes. Typically the entire program is not needed. Exception
More informationVirtual Memory. CSCI 315 Operating Systems Design Department of Computer Science
Virtual Memory CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture were based on those Operating Systems Concepts, 9th ed., by Silberschatz, Galvin, and
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 23 Virtual memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ Is a page replaces when
More informationVirtual Memory. Yannis Smaragdakis, U. Athens
Virtual Memory Yannis Smaragdakis, U. Athens Example Modern Address Space (64-bit Linux) location of code : 0x40057d location of heap : 0xcf2010 location of stack : 0x7fff9ca45fcc 0x400000 0x401000 0xcf2000
More informationChapter 9: Virtual-Memory
Chapter 9: Virtual-Memory Management Chapter 9: Virtual-Memory Management Background Demand Paging Page Replacement Allocation of Frames Thrashing Other Considerations Silberschatz, Galvin and Gagne 2013
More informationReal-time integrated prefetching and caching
Real-time integrated prefetching and caching Peter Sanders Johannes Singler Rob van Stee September 26, 2012 Abstract The high latencies for access to background memory like hard disks or flash memory can
More informationPage Replacement. (and other virtual memory policies) Kevin Webb Swarthmore College March 27, 2018
Page Replacement (and other virtual memory policies) Kevin Webb Swarthmore College March 27, 2018 Today s Goals Making virtual memory virtual : incorporating disk backing. Explore page replacement policies
More information!! What is virtual memory and when is it useful? !! What is demand paging? !! When should pages in memory be replaced?
Chapter 10: Virtual Memory Questions? CSCI [4 6] 730 Operating Systems Virtual Memory!! What is virtual memory and when is it useful?!! What is demand paging?!! When should pages in memory be replaced?!!
More informationMemory Management 3/29/14 21:38
Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014 Memory Management Diagram of a 4 4 plane of
More informationCSE 410 Final Exam Sample Solution 6/08/10
Question 1. (12 points) (caches) (a) One choice in designing cache memories is to pick a block size. Which of the following do you think would be the most reasonable size for cache blocks on a computer
More informationPage 1. Multilevel Memories (Improving performance using a little cash )
Page 1 Multilevel Memories (Improving performance using a little cash ) 1 Page 2 CPU-Memory Bottleneck CPU Memory Performance of high-speed computers is usually limited by memory bandwidth & latency Latency
More informationVirtual Memory - Overview. Programmers View. Virtual Physical. Virtual Physical. Program has its own virtual memory space.
Virtual Memory - Overview Programmers View Process runs in virtual (logical) space may be larger than physical. Paging can implement virtual. Which pages to have in? How much to allow each process? Program
More informationLast Class: Demand Paged Virtual Memory
Last Class: Demand Paged Virtual Memory Benefits of demand paging: Virtual address space can be larger than physical address space. Processes can run without being fully loaded into memory. Processes start
More informationOptimal Algorithm. Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs
Optimal Algorithm Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs page 1 Least Recently Used (LRU) Algorithm Reference string: 1, 2, 3,
More informationCaching and Demand- Paged Virtual Memory
Caching and Demand- Paged Virtual Memory Defini8ons Cache Copy of data that is faster to access than the original Hit: if cache has copy Miss: if cache does not have copy Cache block Unit of cache storage
More informationCS 31: Intro to Systems Virtual Memory. Kevin Webb Swarthmore College November 15, 2018
CS 31: Intro to Systems Virtual Memory Kevin Webb Swarthmore College November 15, 2018 Reading Quiz Memory Abstraction goal: make every process think it has the same memory layout. MUCH simpler for compiler
More informationVirtual Memory. Overview: Virtual Memory. Virtual address space of a process. Virtual Memory. Demand Paging
TDDB68 Concurrent programming and operating systems Overview: Virtual Memory Virtual Memory [SGG7/8] Chapter 9 Background Demand Paging Page Replacement Allocation of Frames Thrashing and Data Access Locality
More informationUnit 2 Buffer Pool Management
Unit 2 Buffer Pool Management Based on: Pages 318-323, 541-542, and 586-587 of Ramakrishnan & Gehrke (text); Silberschatz, et. al. ( Operating System Concepts ); Other sources Original slides by Ed Knorr;
More informationCS162 Operating Systems and Systems Programming Lecture 11 Page Allocation and Replacement"
CS162 Operating Systems and Systems Programming Lecture 11 Page Allocation and Replacement" October 3, 2012 Ion Stoica http://inst.eecs.berkeley.edu/~cs162 Lecture 9 Followup: Inverted Page Table" With
More informationCOMPUTER SCIENCE 4500 OPERATING SYSTEMS
Last update: 1/6/2017 COMPUTER SCIENCE 4500 OPERATING SYSTEMS 2017 Stanley Wileman Module 10: Memory Management Part 2 In This Module 2! We conclude our study of memory management by considering how to!
More informationPAGE REPLACEMENT. Operating Systems 2015 Spring by Euiseong Seo
PAGE REPLACEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics What if the physical memory becomes full? Page replacement algorithms How to manage memory among competing processes? Advanced
More informationMemory. Objectives. Introduction. 6.2 Types of Memory
Memory Objectives Master the concepts of hierarchical memory organization. Understand how each level of memory contributes to system performance, and how the performance is measured. Master the concepts
More informationCSE 120. Translation Lookaside Buffer (TLB) Implemented in Hardware. July 18, Day 5 Memory. Instructor: Neil Rhodes. Software TLB Management
CSE 120 July 18, 2006 Day 5 Memory Instructor: Neil Rhodes Translation Lookaside Buffer (TLB) Implemented in Hardware Cache to map virtual page numbers to page frame Associative memory: HW looks up in
More informationChapter 8 Memory Management
1 Chapter 8 Memory Management The technique we will describe are: 1. Single continuous memory management 2. Partitioned memory management 3. Relocatable partitioned memory management 4. Paged memory management
More informationModule 9: Virtual Memory
Module 9: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing Other Considerations Demand Segmenation 9.1 Background
More informationRecall from Tuesday. Our solution to fragmentation is to split up a process s address space into smaller chunks. Physical Memory OS.
Paging 11/10/16 Recall from Tuesday Our solution to fragmentation is to split up a process s address space into smaller chunks. Physical Memory OS Process 3 Process 3 OS: Place Process 3 Process 1 Process
More informationLecture 17. Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne
Lecture 17 Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne Page Replacement Algorithms Last Lecture: FIFO Optimal Page Replacement LRU LRU Approximation Additional-Reference-Bits
More informationCSCI 4500/8506 Operating Systems
CSCI 4500/8506 Operating Systems Module 10 Memory Management Part 2 Updated: August 21, 2014 2008 Stanley A. Wileman, Jr. Operating Systems Slide 1 1 In This Module We conclude our study of memory management
More informationB-Trees and External Memory
Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 and External Memory 1 1 (2, 4) Trees: Generalization of BSTs Each internal node
More informationEvicMng the best page #2: FIFO. #1: Belady s Algorithm. CS 537 Lecture 11 Page Replacement Policies 11/1/11. Michael SwiF
EvicMng the best page CS 537 Lecture 11 Page Replacement Policies Michael The goal of the page replacement algorithm: reduce fault rate by selecmng best vicmm page to remove the best page to evict is one
More informationQ. How can we remove, or at least reduce, the relationship between program size and physical memory size?
CSCI 4500/8506 Operating Systems Module 10 Memory Management Part 2 Updated: August 21, 2014 2008 Stanley A. Wileman, Jr. Operating Systems Slide 1 In This Module We conclude our study of memory management
More informationChapter 4: Memory Management. Part 1: Mechanisms for Managing Memory
Chapter 4: Memory Management Part 1: Mechanisms for Managing Memory Memory management Basic memory management Swapping Virtual memory Page replacement algorithms Modeling page replacement algorithms Design
More informationHow to create a process? What does process look like?
How to create a process? On Unix systems, executable read by loader Compile time runtime Ken Birman ld loader Cache Compiler: generates one object file per source file Linker: combines all object files
More informationPerform page replacement. (Fig 8.8 [Stal05])
Virtual memory Operations and policies Chapters 3.4. 3.7 1 Policies and methods Fetch policy (Noutopolitiikka) When to load page to memory? Placement policy (Sijoituspolitiikka ) Where to place the new
More informationPrinciples of Operating Systems
Principles of Operating Systems Lecture 21-23 - Virtual Memory Ardalan Amiri Sani (ardalan@uci.edu) [lecture slides contains some content adapted from previous slides by Prof. Nalini Venkatasubramanian,
More informationB-Trees and External Memory
Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 B-Trees and External Memory 1 (2, 4) Trees: Generalization of BSTs Each internal
More informationVirtual Memory. Overview: Virtual Memory. Virtual address space of a process. Virtual Memory
TDIU Operating systems Overview: Virtual Memory Virtual Memory Background Demand Paging Page Replacement Allocation of Frames Thrashing and Data Access Locality [SGG7/8/9] Chapter 9 Copyright Notice: The
More informationSF-LRU Cache Replacement Algorithm
SF-LRU Cache Replacement Algorithm Jaafar Alghazo, Adil Akaaboune, Nazeih Botros Southern Illinois University at Carbondale Department of Electrical and Computer Engineering Carbondale, IL 6291 alghazo@siu.edu,
More informationUnit 2 Buffer Pool Management
Unit 2 Buffer Pool Management Based on: Sections 9.4, 9.4.1, 9.4.2 of Ramakrishnan & Gehrke (text); Silberschatz, et. al. ( Operating System Concepts ); Other sources Original slides by Ed Knorr; Updates
More informationCIS Operating Systems Memory Management Cache Replacement & Review. Professor Qiang Zeng Fall 2017
CIS 5512 - Operating Systems Memory Management Cache Replacement & Review Professor Qiang Zeng Fall 2017 Previous class What is the rela+on between CoW and sharing page frames? CoW is built on sharing
More informationWhere are we in the course?
Previous Lectures Memory Management Approaches Allocate contiguous memory for the whole process Use paging (map fixed size logical pages to physical frames) Use segmentation (user s view of address space
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 L20 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Questions from last time Page
More informationWeek 2: Tiina Niklander
Virtual memory Operations and policies Chapters 3.4. 3.6 Week 2: 17.9.2009 Tiina Niklander 1 Policies and methods Fetch policy (Noutopolitiikka) When to load page to memory? Placement policy (Sijoituspolitiikka
More informationAlgorithmen II. Peter Sanders, Christian Schulz, Simon Gog. Übungen: Michael Axtmann. Institut für Theoretische Informatik, Algorithmik II.
Schulz, Gog, Sanders: Algorithmen II - 31. Januar 2017 Algorithmen II Peter Sanders, Christian Schulz, Simon Gog Übungen: Michael Axtmann Institut für Theoretische Informatik, Algorithmik II Web: http://algo2.iti.kit.edu/algorithmenii_ws16.php
More informationLBM: A Low-power Buffer Management Policy for Heterogeneous Storage in Mobile Consumer Devices
LBM: A Low-power Buffer Management Policy for Heterogeneous Storage in Mobile Consumer Devices Hyojung Kang Department of Computer Science, Ewha University, Seoul, Korea Junseok Park Semiconductor Business,
More informationChapter 9: Virtual Memory
Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating
More informationKarma: Know-it-All Replacement for a Multilevel cache
Karma: Know-it-All Replacement for a Multilevel cache Gala Yadgar Computer Science Department, Technion Assaf Schuster Computer Science Department, Technion Michael Factor IBM Haifa Research Laboratories
More informationLecture 14 Page Replacement Policies
CS 423 Operating Systems Design Lecture 14 Page Replacement Policies Klara Nahrstedt Fall 2011 Based on slides by YY Zhou and Andrew S. Tanenbaum Overview Administrative Issues Page Replacement Policies
More informationVirtual Memory III. Jo, Heeseung
Virtual Memory III Jo, Heeseung Today's Topics What if the physical memory becomes full? Page replacement algorithms How to manage memory among competing processes? Advanced virtual memory techniques Shared
More informationVIRTUAL MEMORY READING: CHAPTER 9
VIRTUAL MEMORY READING: CHAPTER 9 9 MEMORY HIERARCHY Core! Processor! Core! Caching! Main! Memory! (DRAM)!! Caching!! Secondary Storage (SSD)!!!! Secondary Storage (Disk)! L cache exclusive to a single
More informationApplied Algorithm Design Lecture 3
Applied Algorithm Design Lecture 3 Pietro Michiardi Eurecom Pietro Michiardi (Eurecom) Applied Algorithm Design Lecture 3 1 / 75 PART I : GREEDY ALGORITHMS Pietro Michiardi (Eurecom) Applied Algorithm
More informationMemory management, part 2: outline. Operating Systems, 2017, Danny Hendler and Amnon Meisels
Memory management, part 2: outline 1 Page Replacement Algorithms Page fault forces choice o which page must be removed to make room for incoming page? Modified page must first be saved o unmodified just
More informationOperating Systems, Fall
Policies and methods Virtual memory Operations and policies Chapters 3.4. 3.6 Week 2: 17.9.2009 Tiina Niklander 1 Fetch policy (Noutopolitiikka) When to load page to memory? Placement policy (Sijoituspolitiikka
More informationAll Paging Schemes Depend on Locality. VM Page Replacement. Paging. Demand Paging
3/14/2001 1 All Paging Schemes Depend on Locality VM Page Replacement Emin Gun Sirer Processes tend to reference pages in localized patterns Temporal locality» locations referenced recently likely to be
More informationOperating Systems. Overview Virtual memory part 2. Page replacement algorithms. Lecture 7 Memory management 3: Virtual memory
Operating Systems Lecture 7 Memory management : Virtual memory Overview Virtual memory part Page replacement algorithms Frame allocation Thrashing Other considerations Memory over-allocation Efficient
More information22. Swaping: Policies
22. Swaing: Policies Oerating System: Three Easy Pieces 1 Beyond Physical Memory: Policies Memory ressure forces the OS to start aging out ages to make room for actively-used ages. Deciding which age to
More informationFirst-In-First-Out (FIFO) Algorithm
First-In-First-Out (FIFO) Algorithm Reference string: 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1 3 frames (3 pages can be in memory at a time per process) 15 page faults Can vary by reference string:
More informationVirtual Memory. Chapter 8
Virtual Memory 1 Chapter 8 Characteristics of Paging and Segmentation Memory references are dynamically translated into physical addresses at run time E.g., process may be swapped in and out of main memory
More informationBackground. Virtual Memory (2/2) Demand Paging Example. First-In-First-Out (FIFO) Algorithm. Page Replacement Algorithms. Performance of Demand Paging
Virtual Memory (/) Background Page Replacement Allocation of Frames Thrashing Background Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in memory
More informationVirtual or Logical. Logical Addr. MMU (Memory Mgt. Unit) Physical. Addr. 1. (50 ns access)
Virtual Memory - programmer views memory as large address space without concerns about the amount of physical memory or memory management. (What do the terms 3-bit (or 6-bit) operating system or overlays
More informationMemory management, part 2: outline
Memory management, part 2: outline Page replacement algorithms Modeling PR algorithms o Working-set model and algorithms Virtual memory implementation issues 1 Page Replacement Algorithms Page fault forces
More informationLecture 12: Demand Paging
Lecture 1: Demand Paging CSE 10: Principles of Operating Systems Alex C. Snoeren HW 3 Due 11/9 Complete Address Translation We started this topic with the high-level problem of translating virtual addresses
More informationMEMORY: SWAPPING. Shivaram Venkataraman CS 537, Spring 2019
MEMORY: SWAPPING Shivaram Venkataraman CS 537, Spring 2019 ADMINISTRIVIA - Project 2b is out. Due Feb 27 th, 11:59 - Project 1b grades are out Lessons from p2a? 1. Start early! 2. Sketch out a design?
More informationSwitching Between Page Replacement Algorithms Based on Work Load During Runtime in Linux Kernel
San Jose State University SJSU ScholarWorks Master's Projects Master's Theses and Graduate Research Spring 5-22-2017 Switching Between Page Replacement Algorithms Based on Work Load During Runtime in Linux
More informationMemory Management. Virtual Memory. By : Kaushik Vaghani. Prepared By : Kaushik Vaghani
Memory Management Virtual Memory By : Kaushik Vaghani Virtual Memory Background Page Fault Dirty Page / Dirty Bit Demand Paging Copy-on-Write Page Replacement Objectives To describe the benefits of a virtual
More informationBasic Memory Management
Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester 10/15/14 CSC 2/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it
More informationMemory Allocation. Copyright : University of Illinois CS 241 Staff 1
Memory Allocation Copyright : University of Illinois CS 241 Staff 1 Memory allocation within a process What happens when you declare a variable? Allocating a page for every variable wouldn t be efficient
More informationOperating Systems Virtual Memory. Lecture 11 Michael O Boyle
Operating Systems Virtual Memory Lecture 11 Michael O Boyle 1 Paged virtual memory Allows a larger logical address space than physical memory All pages of address space do not need to be in memory the
More informationCS Operating Systems
CS 4500 - Operating Systems Module 10: Memory Management - Part 2 Stanley Wileman Department of Computer Science University of Nebraska at Omaha Omaha, NE 68182-0500, USA June 10, 2017 In This Module...
More informationCS Operating Systems
CS 4500 - Operating Systems Module 10: Memory Management - Part 2 Stanley Wileman Department of Computer Science University of Nebraska at Omaha Omaha, NE 68182-0500, USA June 10, 2017 In This Module...
More informationCSE 153 Design of Operating Systems
CSE 153 Design of Operating Systems Winter 18 Lecture 18/19: Page Replacement Memory Management Memory management systems Physical and virtual addressing; address translation Techniques: Partitioning,
More informationQuestion Points Score Total 100
Midterm #2 CMSC 412 Operating Systems Fall 2005 November 22, 2004 Guidelines This exam has 7 pages (including this one); make sure you have them all. Put your name on each page before starting the exam.
More informationCHAPTER 6 Memory. CMPS375 Class Notes Page 1/ 16 by Kuo-pao Yang
CHAPTER 6 Memory 6.1 Memory 233 6.2 Types of Memory 233 6.3 The Memory Hierarchy 235 6.3.1 Locality of Reference 237 6.4 Cache Memory 237 6.4.1 Cache Mapping Schemes 239 6.4.2 Replacement Policies 247
More informationMEMORY SENSITIVE CACHING IN JAVA
MEMORY SENSITIVE CACHING IN JAVA Iliyan Nenov, Panayot Dobrikov Abstract: This paper describes the architecture of memory sensitive Java cache, which benefits from both the on demand soft reference objects
More informationEvaluating the Impact of Different Document Types on the Performance of Web Cache Replacement Schemes *
Evaluating the Impact of Different Document Types on the Performance of Web Cache Replacement Schemes * Christoph Lindemann and Oliver P. Waldhorst University of Dortmund Department of Computer Science
More informationCS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2014 Lecture 14
CS24: INTRODUCTION TO COMPUTING SYSTEMS Spring 2014 Lecture 14 LAST TIME! Examined several memory technologies: SRAM volatile memory cells built from transistors! Fast to use, larger memory cells (6+ transistors
More information