12-22
x86 MICROPROCESSORS
12.6.5 | Cache Replacement Policies
We know that we cannot let any main memory block reside in memory permanently.
Only the ones that are constantly being used are kept there. If a new block which is
important needs to be transported to the cache and if the cache is found to be full, what is
to be done? The least important of the blocks currently residing in the cache can be over-
written by the new data. However, the ‘catch’ here is how to determine the less important
ones. There are various algorithms for this, and the most popular algorithm is the ‘Least
recently used’ (LRU) algorithm. More algorithms for specific applications are also avail-
able – First-In First-Out (FIFO), Most-Recently Used (MRU), Least-Frequentl ...