lecture24-chapter8 - Operating Systems Lecture 24: Virtual...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Operating Systems Lecture 24: Virtual Memory (cont) Anda Iamnitchi [email protected] 1 Ryan? 2 Belady's Anomaly • Apply FIFO to the following reference string when physical memory available is: – 3 frames – 4 frames 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 3 Clock Policy • Uses and additional bit called a “use bit” • When a page is first loaded in memory or referenced, the use bit is set to 1 • When it is time to replace a page, the OS scans the set flipping all 1’s to 0 • The first frame encountered with the use bit already set to 0 is replaced. 5 Clock Policy Algorithmically identical with another algorithm called “2 nd chance”. Only the implementation is different. 6 Clock Algorithm: Example 7 The 2 nd Chance Algorithm • Holds a FIFO list of pages, each page has a bit R=1 if referenced. • Evict the oldest page not referenced in last tick. • Repeat while oldest has R=1: – Move to end of list (as if just paged in) – Set R=0 • At worst, all pages have R=1, so degenerates to regular FIFO. • Page list if fault occurs at time 20, A has R bit set (numbers above pages are loading times) 8 The Clock Page Replacement Alg • The clock algorithm on 2 bits: referenced R and modified M • Hardware sets corresponding R on every memory reference • At process start, M and R set to 0 • Each circular pass, R bits set to 0. • Pages are classified 1. not referenced, not modified 2. not referenced, modified 3. referenced, not modified 4. referenced, modified • NRU removes page from lowest- numbered non-empty class Clock Policy Example • Note that the clock policy is adept at protecting frames 2 and 5 from replacement. Combined Examples...
View Full Document

This note was uploaded on 02/18/2012 for the course COP 4600 taught by Professor Andaiamnitchi during the Fall '08 term at University of South Florida.

Page1 / 34

lecture24-chapter8 - Operating Systems Lecture 24: Virtual...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online