






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concepts of paging in operating systems, including the cost of paging and page replacement algorithms such as belady's algorithm and fifo. The document also discusses the advantages and disadvantages of different page replacement strategies and approximate lru algorithms.
Typology: Study notes
1 / 12
This page cannot be seen from the preview
Don't miss anything!







effective access time = (1 – p ) * ma + p * page fault time
Page replacement: Goals Reduce fault rate by selecting the “Best” page to replace What is the best page in theory? How can we come close to this? Belady’s Algorithm Optimal page replacement algorithm Evict the page that won’t be used for the longest time in the future.
FIFO: First-In First-Out Replace the oldest page first 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 Physical Memory
Disk
FIFO Advantages/Disadvantages Why use FIFO? Why not use FIFO? “Belady’s Anomaly” LRU: Least Recently Used Replace the page that hasn’t been used in the longest time 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 Physical Memory
Disk
Approximate LRU algorithms Use reference bit… to increment a counter
LRU Clock (Second Chance Algorithm)
Allocation of Frames Fixed vs. Variable Space
Physical Memory
Page Fault Frequency Page Fault Frequency (PFF) is a variable space algorithm that uses a more ad hoc approach
Problem #1? 0 0 1 0 1 2 0 1 1 0 1 2 3 4 5 3 3 5 4 4 3 3 Another problem? What if PFF is high for all processes? Working Set Size Working set size is the number of pages in the working set The working set size changes with program locality 1 2 4 0 2 1 2 4 7 3 3 2 7 3 3 4 3 3 1 3 3 3 3 3 1 3 3 6 3 7 7 7 0 0 1 1…
Thrashing Revisited But sometimes physical memory is just not big enough E.g. Windows 95 with 4MB of memory Solutions? Next time Assignment 6.3, 6.7, 6.10a+b, 8.4, 9.8, 9.
Due Wednesday, Oct 20