110 likes | 282 Vues
Project 3 Page Replacement in Linux. CS-502, Operating Systems Fall 2007 Due, Monday, November 12, 2007. Review – VM Page Replacement. If there is an unused frame, use it. If there are no unused frames available, select a victim (according to policy) and
E N D
Project 3Page Replacement in Linux CS-502, Operating SystemsFall 2007 Due, Monday, November 12, 2007 Project 3 -- Page Replacement
Review – VM Page Replacement • If there is an unused frame, use it. • If there are no unused frames available, select a victim (according to policy) and • If it contains a dirty page (M == 1) • write it to disk • Invalidate its PTE and TLB entry • Load in new page from disk (or create new page) • Update the PTE and TLB entry! • Restart the faulting instruction • What is cost of replacing a page? • How does the OS select the page to be evicted? Project 3 -- Page Replacement
Review – The Best Page to Replace • The best page to replace is the one that will never be accessed again • Optimal Algorithm – Belady’s Rule • Lowest fault rate for any reference string • Basically, replace the page that will not be used for the longest time in the future. • Belady’s Rule is a yardstick • We want to find close approximations Project 3 -- Page Replacement
Page Replacement Strategies and Algorithms • NRU – Not recently used • FIFO – First-in, First-out • Second chance • Page must migrate to top of queue twice • Clock – Second chance in a circular list • Two-handed clock • LRU – Least Recently Used • Unimplementable, but many approximations • … Project 3 -- Page Replacement
Page Replacement Algorithms (continued) • … • Working Set • WS Clock • Combines Working Set and Clock • (not discussed) – Page buffering algorithms • Silbershatz, §9.4.7 Project 3 -- Page Replacement
Project 3 • Discover what your version of Linux kernel does about page replacement • Identify • Code modules and data structures • Daemons • Algorithms • Watch it in action • E.g., printk(), /proc entries, etc. • Write a report • 3-5 pages, explain and document Project 3 -- Page Replacement
Project 3 Resources • Silbershatz, §9.4.7, §21.6.2.3 • Love, Chapter 15 • With recognition of Chapter 14 • Source code of Linux kernel 2.6.18.8-0.5 • Anything else you can find • Each other • And any friends you can con into helping! Project 3 -- Page Replacement
Project 3 Report • How does page replacement really work • Beyond what Love and Silbershatz say in the books • What daemons run, who starts them, how often do they run, what triggers them, etc. • pdflush. Any others? • Identify code modules, functions, and data structures in kernel • Describe any experiments you did to watch page replacement in action • E.g., when running a big program such as kernel build Project 3 -- Page Replacement
Collaboration • You may collaborate with each other in • Research on-line • Experimenting with kernel • Studying kernel code • Etc. • You must write your own report in your own words • 3-5 pages plus any data output from experiments Project 3 -- Page Replacement
Project Submission • Due date – Monday, November 12 • I.e., two weeks from today • Submit report and data output via web-based Turnin system http://turnin.cs.wpi.edu:8088/servlets/turnin.ss • This is Project 3 Project 3 -- Page Replacement
Questions? Project 3 -- Page Replacement