notes18

notes18 - - Page fault is an interrupt created by the MMU...

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

View Full Document Right Arrow Icon
--------------------------- - Page fault is an interrupt created by the MMU when page is not resident - load it from disk to RAM - if RAM is full, find a good candidate page that can be replaced - which page should be replaced : 1. FIFO policy - replace the page that has been in RAM the longest Example: Move 3 pages of RAM hit = accessed a page already in RAM miss = accessed a page NOT in RAM total misses: 6 , total hits: 2 2. Optimal policy - replace the page that will not be used in the future - impractical to implement 3. Least Recently Used (LRU) policy - replace the page that has not been used recently total misses: 5 , total hits: 3 - spacial locality : tendency of a program to use a group of pages more frequently than others - LRU exploits spacial locality and does well in programs that have good spacial locality
Background image of page 1

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

View Full DocumentRight Arrow Icon
- most programs use the same variables more often than other variables and hence LRU is effective - Example of an access sequence : 4,4,5,5,4,4,6,5,5,7,4,4 - To implement LRU, we would need to have a timestamp in each page that is updated when the page is accessed - since this cannot be done fast without special hardware, we will use the access bit instead Clock Algorithm - Initially, all the access bits are clear - If a page needs to be replaced, start at the beginning of the list of pages and if the bit is set, then it gets cleared and that page gets a second chance. If the bit is not set, this means that this page hasn't been used
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

notes18 - - Page fault is an interrupt created by the MMU...

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

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