New entries enter T1, to the left of !, and are gradually pushed to the left, eventually being evicted from T1 into B1, and finally dropped out altogether.Any entry in L1 that gets referenced once more, gets another chance, and enters L2, just to the right of the central ! marker. From there, it is again pushed outward, from T2 into B2. Entries in L2 that get another hit can repeat this indefinitely, until they finally drop out on the far right of B2.
Page Replacement Algorithms
Page replacement algorithms Ubaidullah alias kashif MSCCN-III Sukkur IBA.
Paging:- In computer operating systems, pagingis one of the memory-management schemes bywhich a computer can store and retrieve datafrom secondary storage for use in mainmemory.Page fault The main functions of paging areperformed when a program tries to accesspages that are not currently mapped to physicalmemory (RAM). This situation is known as apage fault.
Page replacement algorithmPage replacement algorithms decide whichmemory pages to page out (swap out, writeto disk) when a page of memory needs to beallocated. Paging happens when a page fault occurs anda free page cannot be used to satisfy theallocation, either because there are none, orbecause the number of free pages is lowerthan some threshold.
ClockThe clock algorithm keeps a circular list of pages inmemory, with the "hand" (iterator) pointing to the lastexamined page frame in the list.
When a page fault occurs and no empty frames exist, then the R(referenced) bit is inspected at the hands location. If R is 0, thenew page is put in place of the page the "hand" pointsto, otherwise the R bit is cleared. Then, the clock hand isincremented and this process is repeated until a page is foundwith R = 0
LRU & NRULRU keeps track of page usage over a short period oftime, while NRU just looks at the usage in the lastclock interval.
Adaptive replacement cacheARC improves the basic LRU strategy by splitting thecache directory into two lists, T1 and T2, for recentlyand frequently referenced entries.In turn, each of these is extended with a ghost list (B1or B2), which is attached to the bottom of the twolists. These ghost lists act as scorecards by keepingtrack of the history of recently evicted (expelled)cache entries, and the algorithm uses ghost hits toadapt to recent change in resource usage.
T1, for recent cache entries.T2, for frequent entries, referenced at least twice.B1, ghost entries recently evicted from the T1 cache, but are stilltracked.B2, similar ghost entries, but evicted from T2.T1 and B1 together are referred to as L1, a combined history ofrecent single references. Similarly, L2 is the combination of T2and B2