Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 765 Bytes

io-cache.md

File metadata and controls

18 lines (12 loc) · 765 Bytes

IO cache

Read/write to block io (disk) go through page cache implemented using LRU/2. Two lists of pages are maintained active and inactive. Page Frame Reclaiming Algorithm (PFRA) manages cache eviction, which only happens in inactive list. Pages are moved from inactive to active list when it is accessed.

Various parameters and the daemon pdflush are employed to ensure that cache will be evicted to free memory when it is needed (dirty_background_ratio, dirty_ratio) as well as un-synchronized data are not remained too long in memory (dirty_expire_centisecs).

Command to drop cache

#free && sync && echo 3 > /proc/sys/vm/drop_caches && free

References

  1. http://www.westnet.com/~gsmith/content/linux-pdflush.htm