CSE 451
Operating Systems
L19 - Page Replacement,
Storage
Slides by: Tom Anderson
Rohan Kadekodi
MIN, LRU, LFU
Belady’s Anomaly
Question
Clock Algorithm: Estimating LRU
Second Chance List
if (page is dirty) {
flush to disk, mark page as clean, unused
} else if (page is used) { mark page as unused
} else {
mark as invalid; put at end of “second chance” list
if page is referenced, pull off “second chance” list, mark
page as valid
}
Recap
Working Set Model
Phase change behavior
Question
# progs
Hit rate
Storage and File Systems
Main Points
Volatile Memory: SRAM and DRAM
Persistent Memory: Flash and Magnetic Disk
5
[J. McCallum, jcmit.org]
DRAM
Flash
Disk
Flash Memory
Flash Memory Challenge
Managing Wearout
⇒ Wearout (of one block) in 10 seconds !
⇒ Disk keeps getting smaller over time…
=> Can’t allow update in place
Flash Translation Layer (FTL)
FTL in Picture Form
Eventually we’ll run out of space…
Erasures
FTL Compaction
Efficient Compaction
Wear Levelling