linux cache與buffer的區別
The page cache caches pages of files to optimize file I/O. The buffer cache caches disk blocks to optimize block I/O.
Prior to Linux kernel version 2.4, the two caches were distinct: Files were in the page cache, disk blocks were in the buffer cache. Given that most files are represented by a filesystem on a disk, data was represented twice, once in each of the caches. Many Unix systems follow a similar pattern.
This is simple to implement, but with an obvious inelegance and inefficiency. Starting with Linux kernel version 2.4, the contents of the two caches were unified. The VM subsystem now drives I/O and it does so out of the page cache. If cached data has both a file and a block representation—as most data does—the buffer cache will simply point into the page cache; thus only one instance of the data is cached in memory. The page cache is what you picture when you think of a disk cache: It caches file data from a disk to make subsequent I/O faster.
The buffer cache remains, however, as the kernel still needs to perform block I/O in terms of blocks, not pages. As most blocks represent file data, most of the buffer cache is represented by the page cache. But a small amount of block data isn't file backed—metadata and raw block I/O for example—and thus is solely represented by the buffer cache.
Short answer: Cached is the size of the page cache. Buffers is the size of in-memory block I/O buffers.
cache快取檔案系統頁,而buffer快取塊IO;2.4兩者合併,現在buffer用途很窄,僅限於raw block
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15480802/viewspace-1168333/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux Buffer/Cache 的區別Linux
- buffer與cache的區別
- Cache 和 Buffer 的區別在哪裡?
- Cache和Buffer都是快取,有什麼區別?Linux快取Linux
- Cache 和 Buffer 有什麼區別?
- 計算機buffer和cache的區別?linux運維學習知識計算機Linux運維
- PostgreSQL DBA(89) - Linux(Buffer vs Cache)SQLLinux
- Linux記憶體、Swap、Cache、BufferLinux記憶體
- 手動釋放Linux上的Swap、Buffer和CacheLinux
- Service Worker Cache 和 HTTP Cache 的區別HTTP
- IO之核心buffer----"buffer cache"
- 33、buffer_cache_3(redo的產生、LRBA、buffer cache裡的等待事件)事件
- Linux工具效能調優系列二:buffer和cacheLinux
- Linux如何手動釋放Swap、Buffer和CacheLinux
- Oracle Cache Buffer ChainsOracleAI
- 【Cache】將常用的“小表”快取到Buffer Cache快取
- Client Side Cache 和 Server Side Cache 的區別clientIDEServer
- 清理buffer/cache/swap的方法梳理
- Buffer Cache以及buffer busy waits/gc相關事件AIGC事件
- 【BUFFER】Oracle buffer cache之 latch 學習記錄Oracle
- [20231023]備庫與alter system flush buffer_cache.txt
- 調整緩衝區快取記憶體(Buffer Cache)的效能(轉)快取記憶體
- Linux的優缺點,Linux與windows的區別LinuxWindows
- Linux程式與執行緒的區別Linux執行緒
- Linux執行緒與程式的區別Linux執行緒
- 【ASK_ORACLE】Library cache pin 與 library load lock的關係和區別Oracle
- Linux中檔案與目錄的區別Linux
- HTTP 頭部欄位 Cache Control max-age = 0 和 no-cache 的區別HTTP
- buffer cache深度分析及效能調整(五)
- buffer cache深度分析及效能調整(四)
- buffer cache深度分析及效能調整(六)
- 轉載_Linux程式與執行緒的區別Linux執行緒
- Linux中程式與程式、執行緒的區別!Linux執行緒
- Linux下su與su -命令的本質區別Linux
- ??與?:的區別
- Linux中程式與執行緒的概念以及區別Linux執行緒
- Linux中“>”和“>>”的區別Linux
- Linux系統iptables與Firewalld防火牆區別?Linux防火牆
- Linux與Windows有什麼區別?linux系統學習LinuxWindows