Linux-MM
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Linux Memory Management

  • Front Page

  • Documentation

  • Internals

  • Projects

  • Academic Research

References

  • LinuxKernelMailingLists

  • MemoryManagementLinks

Related sites

  • Kernel Newbies

  • Memory Management Forum

Wiki

  • Site Editors

  • Side Bar

  • Hosted by WikiWall

Navigation

  • RecentChanges
  • FindPage
  • HelpContents
Revision 2 as of 2006-09-12 19:08:38
LinuxMM:
  • LRU

LRU is Least Recently Used

The following is my current understanding of Linux' LRU implementation, which may be full misleading, full of typos, incorrect, all three or by a very slim chance even useful. Beware!

Most pages are covered by LRU. Exceptions currently include all slab caches. Some slab caches, notably the dentry cache and the various inode caches, tend to grow. Without opposing force, they would occupy all available memory over time. The opposing force comes in the form of "shrinker" calls that free objects from these caches. Balance between regular LRU operations and shrinker calls is magic.

LRU pages belong to one of two linked list, the "active" and the "inactive" list. Page movement is driven by memory pressure. Pages are taken from the end of the inactive list to be freed. If the page has the reference bit set, it is moved to the beginning of the active list and the reference bit is cleared. If the page is dirty, writeback is commenced and the page is moved to the beginning of the inactive list. If the page is unreferenced and clean, it can be reused.

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01