Lecture 15 - Memory management page replacement algorithms design issues. The contents of this chapter include all of the following: Background, topology, network types, communication, communication protocol, robustness, design strategies. | CSC 322 Operating Systems Concepts Lecture - 15: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. (Chapter-3) Ahmed Mumtaz Mustehsan, CIIT, Islamabad 1 Chapter 3 Memory Management Page Replacement Algorithms Design Issues lECTURE-15 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 2 Hardware implementation realizable if affordable. (Not Frequently Used NFU); Software solution. Implementation: Make use of software counters Initially zero, on each clock interrupt OS scans all pages in memory and add R bit (0 or 1) to counter Page fault; Lowest counter page is evicted. Problem; Never forgets anything, . counting of compiler’s pass one is also valid for pass two Solution: (called Aging) The counters are SHR 1 bit, before R bit is added. R bit is added leftmost instead rightmost bit. LRU-software called Not Frequently Used (NFU) lECTURE-15 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 3 LRU in Software called NFU lECTURE-15 Ahmed . | CSC 322 Operating Systems Concepts Lecture - 15: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. (Chapter-3) Ahmed Mumtaz Mustehsan, CIIT, Islamabad 1 Chapter 3 Memory Management Page Replacement Algorithms Design Issues lECTURE-15 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 2 Hardware implementation realizable if affordable. (Not Frequently Used NFU); Software solution. Implementation: Make use of software counters Initially zero, on each clock interrupt OS scans all pages in memory and add R bit (0 or 1) to counter Page fault; Lowest counter page is evicted. Problem; Never forgets anything, . counting of compiler’s pass one is also valid for pass two Solution: (called Aging) The counters are SHR 1 bit, before R bit is added. R bit is added leftmost instead rightmost bit. LRU-software called Not Frequently Used (NFU) lECTURE-15 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 3 LRU in Software called NFU lECTURE-15 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 4 “aging” algorithm Keep a string of values of the R bits for each clock tick (up to some limit) After tick, shift bits right and add new R values on the left On page fault, evict page with lowest counter Size of the counter determines the history NFU Differs from LRU in two ways: No information of the events between time interval. No information beyond 8 clock ticks. LRU-software - NFU lECTURE-15 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 5 Demand Paging Bring a page into memory only when it is needed Less I/O needed Less memory needed Faster response More users Page is needed reference to it invalid reference abort not-in-memory bring to memory Lazy swapper – never swaps a page into memory unless page will be needed Swapper that deals with pages is a pager lECTURE-15 6 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 6 Demand paging-bring a process into memory by trying to execute first instruction and getting page fault. Continue until all pages that process