CS411/511. Operating Systems

Maillist Archive, Spring 1999

Thread Index | Author Index | Subject Index | Date Index

Mail Index [Date Prev][Date Next][Thread Prev][Thread Next]

common project #2 problems


A lot of people made errors in the second chance algorithm.  You had to be
very careful about how you do your search for the LRU clean page (or
barring that, the LRU dirty page).

Most people initialized their "best" frame as the first unlocked frame.
But if this page is dirty and has a very small reference count, there is
no guarantee that you'll find a clean frame with a lower count.  Thus
you'll victimize a dirty page when in fact a clean page is available.

Think over your algorithm carefully before you complain.


Global page replacement policies like those used in this project have
at least the potential to cause starvation.

LFU can certainly cause this.  

Here is an example:

Process A gets CPU
Process A faults on page 42
I/O request is placed to read in page 42 from disk

Process B gets CPU
Process B faults on page 5

Process C gets CPU
Disk brings in page 42 to frame 7, its reference count set to 0
LFU algorithm chooses frame 7 as a victim for B's page 5

Process A gets CPU
Process A faults on page 42


The reference count of a frame is related to how many times the particular
page living in that frame has been hit since it was put into that frame.
Therefore, when a new page is put into that frame, its reference count
should be reset.  
Keith D. Vertanen                  "The cure for boredom is curiosity. 
Oregon State University	             There is no cure for curiosity."
vertanen@cs.orst.edu	                       -Ellen Parr        

Thread Index | Author Index | Subject Index | Date Index