1CSE120Principles of Operating SystemsProf Yuanyuan (YY) ZhouLecture 12: Page Replacement & DisksMay 16, 2011AnnouncementMay 25th: guest lecture by TeradataJune 1st, Wednesday, AndroidMidterm, scheduling solution revision, talk with TA on Thursday’s discussion section if your solution matches with the correct oneMay 15, 2011CSE 1202ReviewAt a memory instruction–Does it use a virtual address or physical address?–What can happen?Best caseWhat if you are unlucky?Demand paging–What is it?–Why introduces it?Page fault–What is it?–Why does it happen?–Who handles it?–How costly is it?May 15, 2011CSE 12035/15/2011CS 323 - Operating Systems, Yuanyuan Zhou4Demand Paging AlgorithmAlgorithm Never bring a page into primary memory until its needed. 1.Page fault 2.Check if a valid virtual memory address. Kill job if not. 3.If valid reference, check if its cached in memory already (perhaps for some other process.) If so, skip to 7). 4.Find a free page frame. If no free page available, choose one to evict4a. If the victim page is dirty, write it out to disk first5.Suspend user process, Map address into disk block and fetch disk block into page frame.. 6.When disk read finished, add vm mapping for page frame. 7.If necessary, restart process.
has intentionally blurred sections.
Sign up to view the full version.