Adaptive Replacement Cache


Adaptive Replacement Cache

Adaptive Replacement Cache (ARC) is a page replacement algorithm with better performance [One Up on LRU, [http://www.usenix.org/publications/login/2003-08/index.html Usenix :login; August 2003] ] than LRU (Least Recently Used) developed [Megiddo and Modha, [http://www.almaden.ibm.com/StorageSystems/projects/arc/ ARC home page] , with pointers to several articles] at the IBM Almaden Research Center. This is accomplished by keeping track of both Frequently Used and Recently Used pages plus a recent eviction history for both.

ummary

Basic LRU maintains an ordered list (the cache directory) of resource entries in the cache, with the sort order based on the time of most recent access. New entries are added at the top of the list, after the bottom entry has been evicted. Cache hits move to the top, pushing all other entries down.

ARC improves the basic LRU strategy by splitting the cache directory into two lists, T1 and T2, for recently and frequently referenced entries. In turn, each of these is extended with a "ghost" list (B1 or B2), which is attached to the bottom of the two lists. These "ghost" lists act as scorecards by keeping track of the history of recently evicted cache entries, and the algorithm uses "ghost" hits to adapt to recent change in resource usage. Note that the "ghost" lists only contain metadata (keys for the entries) and not the resource data itself, i.e. as an entry is evicted into a "ghost" list its data is discarded. The combined cache directory is organised in four LRU lists:

# T1, for recent cache entries
# T2, for frequent entries, referenced at least twice
# B1, "ghost" entries recently evicted from the T1 cache, but are still tracked.
# B2, similar "ghost" entries, but evicted from T2.

T1 and B1 together are referred to as L1, a combined history of recent single references.Similarly, L2 is the combination of T2 and B2.

The whole cache directory can be visualised in a single line:

. . . [ B1 <- [ T1 <-!-> T2 ] -> B2 ] . . [ . . . . [ . . . . . . ! . .^. . . . ] . . . . ] [ fixed cache size (c) ]

The inner [ ] brackets indicate actual cache, which although fixed in size, can move freely across the B1 and B2 history.

L1 is now displayed from right to left, starting at the top, indicated by the ! marker. ^ indicates the target size for T1, and may be equal to, smaller than, or larger than the actual size (as indicated by !).

* 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.

Replacement

Entries (re-)entering the cache (T1,T2) will cause ! to move towards the target marker ^. If no free space exists in the cache, this marker also determines whether either T1 or T2 will evict an entry.

* Hits in B1 will increase the size of T1, pushing ^ to the right. The last entry in T2 is evicted into B2.

* Hits in B2 will shrink T1, pushing ^ back to the left. The last entry in T1 is now evicted into B1.

* A cache miss will not affect ^, but the ! boundary will move closer to ^.

Deployment

ARC is currently deployed in IBM's DS6000/DS8000 storage controllers.

Sun Microsystems's scalable file system ZFS uses a variant [comments in Solaris ZFS [http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/zfs/arc.c arc.c ] source file explains differences with original work ] of ARC as an alternative to the traditional Solaris filesystem page cache in virtual memory. It has been modified to allow for locked pages that are currently in use and can not be vacated.

PostgreSQL used ARC in its buffer manager for a brief time (version 8.0.0), but quickly replaced it with another algorithm,citing concerns over an IBM patent on ARC. [Article in Postgesql General Bits, [http://www.varlena.com/GeneralBits/96.php "The Saga of the ARC Algorithm and Patent"] , published 6-Feb-2005]

References

External links

* [http://linux-mm.org/AdvancedPageReplacement Linux Memory Management Wiki]
*Bourbonnais, Roch. [http://blogs.sun.com/roch/date/20060621 ZFS Dynamics]
* [http://code.activestate.com/recipes/576532/ Python implementation, recipe 576532]


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • Clock with Adaptive Replacement — (CAR) is a page replacement algorithm, which combines Adaptive Replacement Cache (ARC) and CLOCK, and it has performance comparable to ARC, and substantially outperforms both LRU and CLOCK[1]. The algorithm CAR is self tuning and requires no user …   Wikipedia

  • Cache algorithms — This article is about general cache algorithms. For detailed algorithms specific to paging, see page replacement algorithm. For detailed algorithms specific to the cache between a CPU and RAM, see CPU cache. In computing, cache algorithms (also… …   Wikipedia

  • Page replacement algorithm — This article is about algorithms specific to paging. For outline of general cache algorithms (e.g. processor, disk, database, web), see Cache algorithms. In a computer operating system that uses paging for virtual memory management, page… …   Wikipedia

  • Алгоритмы кэширования — В информатике под алгоритмами кэширования (часто называемыми алгоритмами вытеснения или политиками вытеснения, а также «алгоритмами/политиками замещения») понимают оптимизацию инструкций  алгоритмы  особая компьютерная программа или… …   Википедия

  • Кэш — У этого термина существуют и другие значения, см. Кэш (значения). Кэш[1][2][3] или кеш[4][5][6] (англ. cache, от фр. cacher  «прятать»; произносится [kæʃ]  «кэш»)  промежуточный …   Википедия

  • Список алгоритмов — Эта страница информационный список. Основная статья: Алгоритм Ниже приводится список алгоритмов, группированный по категориям. Более детальные сведения приводятся в списке структур данных и …   Википедия

  • List of computing and IT abbreviations — This is a list of computing and IT acronyms and abbreviations. Contents: 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y …   Wikipedia

  • Сверхоперативная память — Кэш (англ. cache[1], произносится kæʃ кЭш)  промежуточный буфер с быстрым доступом, содержащий копию той информации, которая хранится в памяти с менее быстрым доступом, но с наибольшей вероятностью может быть оттуда запрошена. Доступ к данным в… …   Википедия

  • Дисковый кэш — Кэш (англ. cache[1], произносится kæʃ кЭш)  промежуточный буфер с быстрым доступом, содержащий копию той информации, которая хранится в памяти с менее быстрым доступом, но с наибольшей вероятностью может быть оттуда запрошена. Доступ к данным в… …   Википедия

  • Дисковый кеш — Кэш (англ. cache[1], произносится kæʃ кЭш)  промежуточный буфер с быстрым доступом, содержащий копию той информации, которая хранится в памяти с менее быстрым доступом, но с наибольшей вероятностью может быть оттуда запрошена. Доступ к данным в… …   Википедия


Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”

We are using cookies for the best presentation of our site. Continuing to use this site, you agree with this.