Why Are File Caches Effective?
1. Locality of reference: storage accesses come in clumps.
- spatial locality: If a process accesses data in block B, it is likely to reference other nearby data soon.
(e.g., the remainder of block B)
example: reading or writing a file one byte at a time
- temporal locality: Recently accessed data is likely to be used again.
2. Read-ahead: if we can predict what blocks will be needed soon, we can prefetch them into the cache.
- most files are accessed sequentially