15
Replacement Policies BY: SHARMAINE B. TAN

Replacement Policies Summary of Mr Hayes

Embed Size (px)

DESCRIPTION

Brief Lecture about the different Replacement Policies as written on Mr. Hayes Book of Computer Architecture and Organization.

Citation preview

Replacement Policies

Replacement PoliciesBy: Sharmaine B. Tan> FIFO (3 page frame and 4 page frame)> LRU (3 page frame and 4 page frame)> OPT (3 page frame and 4 page frame)>how it works>sampleFigure 6.36 and Figure 6.37

Replacement PoliciesREGION RBLOCK KBLOCK KREGION RBLOCK KMain Goal in choosing aReplacement Policymaximize the *hit ratio minimize the number of memory fault or miss. OPTIMAL REPLACEMENT (OPT)OPT can be implemented by making 2 passes

>simulation run

>execution run2 Useful Replacement PoliciesFIFO (First in First out)HOW IT WORKSADVANTAGEHOW IT IS IMPLEMENTEDDISADVANTAGELRU (Least Recently Used)HOW IT WORKSWHY IT WORKS THIS WAYADVANTAGEDISADVANTAGE

The highest page hit ratio is achieved by OPT the lowest by FIFO. The page hit ratio of LRU is quite close to that of OPT, a property that seems to hold generally.3 7 6 4 6 2 1 9 2 8 -FIFO337637647647642142192192198HITHIT3 7 6 4 6 2 1 9 2 8 -LRU337637647647642612912912982HITHIT3 7 6 4 6 2 1 9 2 8 -OPT337637647647642142192192198HITHIT123412512345

1 2 3 4 1 2 5 1 2 3 4 5-LRU112312342341241251251251231HITHIT2345341 2 3 4 1 2 5 1 2 3 4 5-LRU112312312312312512512512312312352444444444HITHITHITHITHIT1 2 3 4 1 2 5 1 2 3 4 5- OPT112312412412412512512512532HITHIT534534HITHITHIT1 2 3 4 1 2 5 1 2 3 4 5- OPT112312312312312312312312312342342444555555HITHITHITHITHITHIT