Share to: share facebook share twitter share wa share telegram print page

LIRS caching algorithm

LIRS (Low Inter-reference Recency Set) is a page replacement algorithm with an improved performance over LRU (Least Recently Used) and many other newer replacement algorithms.[1] This is achieved by using "reuse distance"[2] as the locality metric for dynamically ranking accessed pages to make a replacement decision.

Summary

Quantifying the locality

While all page replacement algorithms rely on existence of reference locality to function, a major difference among different replacement algorithms is on how this locality is quantified. LIRS uses reuse distance of a page, or the number of distinct pages accessed between two consecutive references of the page, to quantify locality. Specifically, LIRS uses last and second-to-last references (if any) for this purpose. If a page is accessed for the first time, its reuse distance is infinite. In contrast, LRU uses recency of a page, which is the number of distinctive pages accessed after the reference of the page, to quantify locality. To take into account of up-to-date access history, the implementation of LIRS actually uses the larger of reuse distance and recency of a page as the metric to quantify its locality, denoted as RD-R. Assuming the cache has a capacity of C pages, the LIRS algorithm is to rank recently accessed pages according to their RD-R values and retain the C most highly ranked pages in the cache.

The concepts of reuse distance and recency can be visualized as below, in which T1 and T2 are page B’s second-to-last and last reference times, respectively, and T3 is the current time.

 . . . B . . . B . . . . . . . . . . B . . . . . 
               ^----Reuse Distance---^--Recency--^
               T1                    T2          T3

Selecting the replacement victim

LIRS organizes metadata of cached pages and some uncached pages and conducts its replacement operations described as below, which are also illustrated with an example [3] in the graph.

Replacement operations of LIRS
  1. The cache is divided into a Low Inter-reference Recency (LIR) and a High Inter-reference Recency (HIR) partition. The LIR partition is to store the most highly ranked pages (LIR pages) and the HIR partition is to store some of the other pages (HIR pages).
  2. The LIR partition holds the majority of the cache, and all LIR pages are resident in the cache.
  3. All recently accessed pages are placed in a FIFO queue called the LIRS stack (stack S in the graph), and all resident HIR pages are also placed in another FIFO queue (stack Q in the graph).
  4. An accessed page is moved to the top of Stack S and any HIR pages at the stack's bottom are removed. For example, Graph (b) is produced after page B is accessed on Graph (a).
  5. When a HIR page in Stack S is accessed, it turns into a LIR page and accordingly the LIR page currently at Stack S’s bottom turns into a HIR page and moves to the top of Stack Q. For example, Graph (c) is produced after page E is accessed on Graph (a).
  6. When there is a miss and a resident page has to be replaced, the resident HIR page at the bottom of Stack Q is selected as the victim for replacement. For example, Graphs (d) and (e) are produced after pages D and C are accessed on Graph (a), respectively.

Deployment

LIRS has been deployed in MySQL since version 5.1,[4] and another reference by link. It is also adopted in Infinispan data grid platform.[5] An approximation of LIRS, CLOCK-Pro,[6] is adopted in NetBSD.[7] LIRS is adopted in Apache Jackrabbit, a Content Repository. An in-memory LIRS cache is developed in the Red Hat JBoss Data Virtualization System. LIRS is used in the H2 Database Engine, which is called a Scan Resistant Cache. Furthermore, LIRS is used in Apache Impala, a data processing with Hadoop.

See also

References

  1. ^ Jiang, Song; Zhang, Xiaodong (June 2002). "LIRS: an efficient low inter-reference recency set replacement policy to improve buffer cache performance". ACM SIGMETRICS Performance Evaluation Review. 30 (1): 31–42. doi:10.1145/511399.511340.
  2. ^ Mattson, R.L.; Gecsei, J.; Slutz, D. R.; Traiger, I. L. (1970). "Evaluation techniques for storage hierarchies". IBM Systems Journal. 9 (2): 78–117. doi:10.1147/sj.92.0078.
  3. ^ Song Jiang; Xiaodong Zhang (2005). "Making LRU Friendly to Weak Locality Workloads: A Novel Replacement Algorithm to Improve Buffer Cache Performance". IEEE Transactions on Computers. 54 (8): 939–952. doi:10.1109/TC.2005.130. S2CID 11539061.
  4. ^ svn commit - mysqldoc@docsrva: r6768 - trunk/ndbapi
  5. ^ Infinispan eviction, batching updates and LIRS
  6. ^ Song Jiang, Feng Chen, and Xiaodong Zhang, "CLOCK-Pro: An Effective Improvement of the CLOCK Replacement", in Proceedings of 2005 USENIX Annual Technical Conference (USENIX'05), Anaheim, CA, April, 2005.
  7. ^ FreeBSD/Linux Kernel Cross Reference sys/uvm/uvm_pdpolicy_clockpro.c
  • Towards an O(1) VM by Rik van Riel about the possible use of LIRS for balancing cache and program memory in Linux.
  • A report on the implementation of the CLOCK-Pro page replacement.
  • Advanced Page Replacement Projects established by the Linux memory management development team.
  • CLOCK-Pro patch developed by Rik van Riel.
  • CLOCK-Pro patch developed by Peter Zijlstra.
  • CLOCK-Pro is referred as an example in the section of Linux and Academia in Book Professional Linux Kernel Architecture by Wolfgan Mauerer.
  • A paper detailing performance differences of LIRS and other algorithms “The Performance Impact of Kernel Prefetching on Buffer Cache Replacement Algorithms” by Ali R. Butt, Chris Gniady, and Y. Charlie Hu.

This information is adapted from Wikipedia which is publicly available.

Read other articles:

WK voetbal 2022 Senegal Nederland 0 2 Dit artikel gaat over de wedstrijd in de groepsfase in groep A van het wereldkampioenschap voetbal 2022 tussen Senegal en Nederland die gespeeld werd op maandag 21 november 2022 in het Al Thumamastadion te Doha. Het duel was de derde wedstrijd van het toernooi. Nederland won de wedstrijd met 0–2, dankzij doelpunten van Cody Gakpo en Davy Klaassen in de slotfase. Andries Noppert werd de tweede speler die voor Oranje debuteerde op een WK-eindronde, na Dick S…

Kållands härad Härad Söne kyrka Kållands häradsvapen Land  Sverige Län Skaraborgs län Landskap Västergötland Socknar Järpås sockenUvereds sockenHäggesleds sockenTådene sockenTranums sockenLavads sockenNorra Kedums sockenÖrslösa sockenSöne sockenGillstads sockenVäla sockenRåda sockenKållands-Åsaka sockenMellby sockenRackeby sockenSkalunda sockenSunnersbergs sockenGösslunda sockenStrö sockenOtterstads socken Kållands härads läge (klickbar karta) Kållands härad var …

American politician (1812–1861) For other people named James Adams, see James Adams (disambiguation). James Hopkins Adams66th Governor of South CarolinaIn officeDecember 11, 1854 – December 9, 1856LieutenantRichard de TrevillePreceded byJohn Lawrence ManningSucceeded byRobert Francis Withers AllstonMember of the South Carolina Senate from the Richland DistrictIn officeNovember 24, 1851 – November 27, 1854Member of the South Carolina House of Representatives from the Richla…

ألبرت موزس   معلومات شخصية الميلاد 19 ديسمبر 1937  سيلان البريطانية  الوفاة 15 سبتمبر 2017 (79 سنة)   لندن  مواطنة المملكة المتحدة  الحياة العملية المهنة ممثل،  وممثل أفلام،  وممثل تلفزيوني  اللغات الإنجليزية  المواقع الموقع الموقع الرسمي  IMDB صفحته على IMDB&…

The Ethnic Power Relations (EPR) dataset identifies all politically relevant ethnic groups, their size, and their access to state power in every country of the world with a population of at least 250,000 from 1946 to 2017. It includes annual data on over 800 groups and codes the degree to which their representatives hold executive-level state power, from total control of the government, power-sharing to overt political discrimination. Also, it provides information on regional autonomy arrangemen…

Aline kan verwijzen naar: Aline (Oklahoma) Aline (planetoïde) Aline (film) (eigenlijk: Aline_) Aline (lied) - hit van de Franse zanger Christophe Bekijk alle artikelen waarvan de titel begint met Aline of met Aline in de titel. Dit is een doorverwijspagina, bedoeld om de verschillen in betekenis of gebruik van Aline inzichtelijk te maken. Op deze pagina staat een uitleg van de verschillende betekenissen van Aline en verwijzingen daarnaartoe. Bent u hier via een pagina i…

أيمن زيدان معلومات شخصية اسم الولادة أيمن غالب شكري الزيداني الميلاد 1 سبتمبر 1956 (العمر 67 سنة)الرحيبة الجنسية  سوريا أسماء أخرى إمبراطور الدراما العربية[1] الديانة الإسلام الزوجة نورمان أسعد (زواج 1998- طلاق 1999، زواج2000 - طلاق2003) الأولاد غالب حازمنورة نوار (توفي عام 2011) يمن

Graf van de onbekende soldaat in Parijs Het Graf van de onbekende soldaat is een monument in Parijs waar het stoffelijk overschot begraven werd van een onbekende soldaat. Aan het eind van de Eerste Wereldoorlog werd op Wapenstilstandsdag (11 november 1918) de Duitse capitulatie getekend. Sindsdien wordt deze dag elk jaar herdacht. Al in 1916 werd het idee van een graf voor de onbekende soldaat in het Panthéon geopperd. Op 8 november 1920 werd een wet aangenomen voor de begrafenis van een onbeke…

Bagian dari seriIslam Rukun Iman Keesaan Allah Nabi dan Rasul Allah Kitab-kitab Allah Malaikat Hari Kiamat Qada dan Qadar Rukun Islam Syahadat Salat Zakat Puasa Haji Sumber hukum Islam al-Qur'an Sunnah (Hadis, Sirah) Tafsir Akidah Fikih Syariat Sejarah Garis waktu Muhammad Ahlulbait Sahabat Nabi Khulafaur Rasyidin Khalifah Imamah Ilmu pengetahuan Islam abad pertengahan Penyebaran Islam Penerus Muhammad Budaya dan masyarakat Akademik Akhlak Anak-anak Dakwah Demografi Ekonomi Feminisme Filsafat Ha…

Коронавірусна інфекціяСпеціальність інфекційні хворобиПричини коронавіруси, Severe acute respiratory syndrome-related coronavirus, MERS-CoV, SARS-CoV-2, Human coronavirus 229Ed, Human coronavirus OC43, Human coronavirus NL63d і Human coronavirus HKU1Метод діагностики реакція імунофлюоресценції, ІФА і ПЛРКласифікація та з…

مسييه 13   بيانات المراقبة الكوكبة الجاثي البعد 22200 سنة ضوئية (6800 فرسخ فلكي) القدر الظاهري (V) 5.8+ النوع عنقود نجمي مغلق سرعة شعاعية -244.2 كيلومتر في الثانية[1]،  و-246.6 كيلومتر في الثانية[1]  معدنية (فلك) 1.33- = [F/H] كتلة شمسية 4^10 × 6 العمر المقدر 11.65 مليار سنة القدر المطلق(H) -…

German ophthalmologist For the German politician, see Albrecht von Graefe (politician). Albrecht von GräfeBorn(1828-05-22)22 May 1828Finkenheerd, BrandenburgDied20 July 1870(1870-07-20) (aged 42)Berlin, BrandenburgNationalityPrussianAlma materHumboldt University of BerlinKnown fortreatment of glaucomaScientific careerFieldsophthalmology Friedrich Wilhelm Ernst Albrecht von Gräfe,[1] often Anglicized to Graefe[2] (22 May 1828 – 20 July 1870), was a …

العلاقات السعودية الصربية السعودية صربيا   السعودية   صربيا تعديل مصدري - تعديل   العلاقات السعودية الصربية هي العلاقات الثنائية التي تجمع بين السعودية وصربيا.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية للدولتين: وجه المقارنة السع…

Radio station in Hope, ArkansasKBYBHope, ArkansasBroadcast areaTexarkana, ArkansasFrequency101.7 MHzBranding101.7 Hot FMProgrammingFormatCountry musicOwnershipOwnerCliff Dumas(BTC USA Holdings Management Inc.)Sister stationsKCMC, KTFS, KTFS-FM, KTOY, KTTYHistoryFirst air date1984; 39 years ago (1984)Former call signsKXAR-FM (1984-2001)KTXO (2001-2003)KJMY (2003-2004)Technical information[1]Licensing authorityFCCFacility ID33762ClassC2ERP50,000 wattsHAAT150 meters (490&#…

Magnesium oksida Nama Nama IUPAC Magnesium oksida Nama lain MagnesiaPeriklase Penanda Nomor CAS 1309-48-4 Y 3DMet {{{3DMet}}} ChEMBL ChEMBL1200572 N Nomor EC PubChem CID 14792 Nomor RTECS {{{value}}} CompTox Dashboard (EPA) DTXSID9049665 Sifat Rumus kimia MgO Massa molar 40.3044 g/mol Penampilan Bubuk putih Bau Tak berbau Densitas 3.58 g/cm3 Titik lebur 2.852 °C (5.166 °F; 3.125 K) Titik didih 3.600 °C (6.510 °F; 3.870&#…

لعنة تشاكيCurse of Chuckyمعلومات عامةالصنف الفني رعبالموضوع عائلة مختلة تاريخ الصدور 2 أوت 2013مدة العرض 97 دقيقةاللغة الأصلية الإنجليزيةالبلد  الولايات المتحدةموقع الويب curseofchucky.com[1] الطاقمالمخرج دون مانشينيالكاتب دون مانشينيالسيناريو دون مانشيني البطولة براد دوريفشانتال…

National flag This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Flag of Thailand – news · newspapers · books · scholar · JSTOR (September 2017) (Learn how and when to remove this template message) Kingdom of ThailandTrairanga (Thai: ธงไตรรงค์, RTGS: thong trai rong), 'Tricolour flag'UseNational …

Dirección General del Patrimonio del Estado Logotipo de la Dirección General del Patrimonio del Estado LocalizaciónPaís España EspañaInformación generalSigla DGPEJurisdicción EspañaTipo Dirección GeneralSede Calle de Alcalá, 928014 MadridOrganizaciónDirector General Juan Tejedor CarneroDepende de Subsecretaría de HaciendaEntidad superior Ministerio de Hacienda y Función PúblicaEmpleados 149 (31 de diciembre de 2021)[1]​Presupuesto 236 millones de € (2023)[2]…

Эта статья — часть серии «История Европейского союза»Европейский союзХронология истории Европейского союза: 1945—1957 ЕОУС Парижский договор 1958—1972 ЕЭС Евратом Комиссия Хальштейна Комиссия Рея Комиссия Маншольта Римский договор ЕЕА 1973—1993[en] Комиссия Ортоли Комиссия Джен…

Neighborhood in Chicago This article's use of red links may need cleanup. Please help improve this article. (November 2023) Part of a series onEthnic groups in Chicago Armenians Afghans African Americans Albanians Appalachian Assyrians Austrians Belarusians Belgians Bosnians Brazilians Chinese Croatians Czechs Dutch English Estonians Finns Germans Ghanaians Guatemalans Greeks Iranians Iraqi Irish Indians Italians Japanese Jews Koreans Latvians Lithuanians Luxembourgers Mexicans Native peoples Ni…

Kembali kehalaman sebelumnya

Lokasi Pengunjung: 3.137.210.143