4.5 Modeling page replacement algorithms by hcj

VIEWS: 32 PAGES: 9

									4.5 Modeling page
replacement algorithms
Belady’s anomaly
   Intuitively, the more page frames we have the
    better (i.e., less page faults).

   This is NOT always true for all page
    replacement algorithms!

   Ex. FIFO exhibits Belady’s anomaly; LRU
    does not.
FIFO and Belady’s anomaly
Characterizing page replacement
algorithms
1.   Reference string (ordered list of pages
     referred to by a process as it executes)
2.   Page replacement algorithm
3.   m=number of page frames available in
     memory
4.   M=set of pages currently in memory
Ex. LRU

M   {
    {
not in
memory
Stack algorithms
Algorithms which exhibit:



                   M m ,r  M m 1,r
where M is the set of pages currently in memory, m is the number
   of page frames, and r is the r th memory reference in the
   reference string.

   LRU has this property; FIFO does not.
   Stacking algorithms do NOT suffer from Belady’s anomaly.
Distance string
    distance from top of stack


    top

          not present
Distance string
More normal distribution (left) satisfied w/ k
  page frames than uniform (right).
Predicting page fault rates
          20
          18
          17
          13
          11
          9

                             n
                                  
                    Fm    Ck   C
          8



                          k m1 

								
To top