Final Exam Part 2 Flashcards
The two things you need for any replacement algorithm:
- main memory size (ex. 4 frames)
2. sequence of pages that a running program request
Reason why the performance metric for replacement algorithims is based on the hit rate:
the higher the hit rate, the lower the response time
FIFO/FCFS (Replacement algorithm)
First In First Out/First Come First Serve; The order in which the page request occur is the order in which they are executed.
The best replacement policy is _____
OPT (Optimum Policy)
OPT (Replacement algorithm)
Optimum Policy; look into the future and remove the policy that is not used in the near future
OPT makes sense to use in real life (T or F)
False. how would you predict the future
LRU (Replacement algorithm)
Least Recently Used; the page that was used the least recently is replaced
LRU is never implemented in real life systems (T or F)
False. some version of LRU is implemented in all file system caches
MRU (Replacement algorithm)
Most Recently Used; the page that was used the most recently is replaced
Where is MRU implemented?
lower level cache, like storage cache
Why is LRU never implemented as a memory page replacement policy?
The OS has to be called on every page hit to rearrange the replacement queue
NUR (Replacement algorithm)
Not Used Recently; has a reference bit and a pointer. The reference bit is set to 1 every time a page is reference and the pointer points to the next frame to be replaced
what is the relationship between NUR and LRU
NUR is a LRU approximation
Goal of OS replacement schemes
- lower page faults
2. ensures that the CPU is utilized
When CPU utilization is low, the OS loads more programs into MM to keep CPU busy
True
thrashing
when a program spends more time page faulting than executing; indicated too few pages in MM
solution to thrashing
ensure that every program in MM has the minimum # of pages; Working Set Model
Working Set Model
working set of a program: set of pages of his program that must be in MM while the program is executing; implies that the pages in the working set cannot be in the replacement queue
Most OS use:
working set model and some version of NUR replacement policy
requirement for working set model
working set + replacement queue must be less than or equal to the number of MM frames
disk access time =
seek time + rotational latency + transfer time
seek time =
time for the read/write head to move to the correct cylinder
rotational latency =
time for the correct sector to arrive under the head
transfer time =
time to transfer data to/from the disk