Lecture 4 Flashcards
The goal of any page replacement algorithm (policy)
Minimize page faults
What are the strings of memory page references worked on by the replacement algorithm?
pointers (page numbers) to actual memory pages that are stored somewhere in memory
When does a page fault occur?
Given page is not loaded into physical memory and ready for immediate execution.
What is the ideal page to evict by the page replacement algorithm?
A page that is not likely to be used again in the near future.
Random page replacement.
A random frame in physical memory is selected and the page in this frame removed (evicted), and the evicted page replaced with the page next scheduled
to run on the CPU.
Principle of locality
The tendency of the CPU to
access the same set of memory locations repetitively over a short time period.
First In, First Out (F IF O)
Allows every page to spend the same amount of time in a physical memory frame.
The main advantage of FIFO
Easy to implement with just a single
pointer to the list of frames in physical memory (pointing to the page that has been
in main memory the longest)
Disadvantage of FIFO
Doesn’t necessarily keep frequently used pages in memory and replace infrequently used pages to minimize page faults.
What data structure does FIFO use to keep a list of pages?
A linked list, that maintains the order that pages entered memory so the first page in the linked list is replaced.
OPT (Optimal) algorithm
Used as a bench-mark algorithm for the design and testing of other page replacement algorithms
How does the optimal algorithm work?
Assumes that the page that will not be used for the longest period of time will be the page selected for replacement
An effective page replacement algorithm.
A page replacement algorithm that yields a task performance (minimizing page faults) within 5% of the OP T algorithm.
LRU (Least Recently Used) performance
Better task performance (lower number of page faults)
than F IF O, but a worse task performance than OP T
LRU (Least Recently Used)
Accounts for the principle of locality
That is, that the same set of pages will tend to be frequently used while the process is executing, so these pages should not be swapped out of main memory.